browser_animation_summary-graph_computed-timing-path_2.js (4233B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test for following ComputedTimingPath component works. 7 // * element existance 8 // * iterations: path, count 9 // * delay: path 10 // * fill: path 11 // * endDelay: path 12 13 /* import-globals-from summary-graph_computed-timing-path_head.js */ 14 Services.scriptloader.loadSubScript( 15 CHROME_URL_ROOT + "summary-graph_computed-timing-path_head.js", 16 this 17 ); 18 19 const TEST_DATA = [ 20 { 21 targetClass: "fill-backwards", 22 expectedIterationPathList: [ 23 [ 24 { x: 0, y: 0 }, 25 { x: 250000, y: 25 }, 26 { x: 500000, y: 50 }, 27 { x: 750000, y: 75 }, 28 { x: 1000000, y: 100 }, 29 { x: 1000000, y: 0 }, 30 ], 31 ], 32 }, 33 { 34 targetClass: "fill-backwards-with-delay-iterationstart", 35 expectedDelayPath: [ 36 { x: 0, y: 0 }, 37 { x: 0, y: 50 }, 38 { x: 500000, y: 50 }, 39 { x: 500000, y: 0 }, 40 ], 41 expectedIterationPathList: [ 42 [ 43 { x: 500000, y: 50 }, 44 { x: 750000, y: 75 }, 45 { x: 1000000, y: 100 }, 46 { x: 1000000, y: 0 }, 47 ], 48 [ 49 { x: 1000000, y: 0 }, 50 { x: 1250000, y: 25 }, 51 { x: 1500000, y: 50 }, 52 { x: 1500000, y: 0 }, 53 ], 54 ], 55 }, 56 { 57 targetClass: "fill-both", 58 expectedIterationPathList: [ 59 [ 60 { x: 0, y: 0 }, 61 { x: 250000, y: 25 }, 62 { x: 500000, y: 50 }, 63 { x: 750000, y: 75 }, 64 { x: 1000000, y: 100 }, 65 { x: 1000000, y: 0 }, 66 ], 67 ], 68 expectedForwardsPath: [ 69 { x: 1000000, y: 0 }, 70 { x: 1000000, y: 100 }, 71 { x: 1500000, y: 100 }, 72 { x: 1500000, y: 0 }, 73 ], 74 }, 75 { 76 targetClass: "fill-both-width-delay-iterationstart", 77 expectedDelayPath: [ 78 { x: 0, y: 0 }, 79 { x: 0, y: 50 }, 80 { x: 500000, y: 50 }, 81 { x: 500000, y: 0 }, 82 ], 83 expectedIterationPathList: [ 84 [ 85 { x: 500000, y: 50 }, 86 { x: 750000, y: 75 }, 87 { x: 1000000, y: 100 }, 88 { x: 1000000, y: 0 }, 89 ], 90 [ 91 { x: 1000000, y: 0 }, 92 { x: 1250000, y: 25 }, 93 { x: 1500000, y: 50 }, 94 { x: 1500000, y: 0 }, 95 ], 96 ], 97 expectedForwardsPath: [ 98 { x: 1500000, y: 0 }, 99 { x: 1500000, y: 50 }, 100 ], 101 }, 102 { 103 targetClass: "fill-forwards", 104 expectedIterationPathList: [ 105 [ 106 { x: 0, y: 0 }, 107 { x: 250000, y: 25 }, 108 { x: 500000, y: 50 }, 109 { x: 750000, y: 75 }, 110 { x: 1000000, y: 100 }, 111 { x: 1000000, y: 0 }, 112 ], 113 ], 114 expectedForwardsPath: [ 115 { x: 1000000, y: 0 }, 116 { x: 1000000, y: 100 }, 117 { x: 1500000, y: 100 }, 118 { x: 1500000, y: 0 }, 119 ], 120 }, 121 { 122 targetClass: "iterationstart", 123 expectedIterationPathList: [ 124 [ 125 { x: 0, y: 50 }, 126 { x: 250000, y: 75 }, 127 { x: 500000, y: 100 }, 128 { x: 500000, y: 0 }, 129 ], 130 [ 131 { x: 500000, y: 0 }, 132 { x: 750000, y: 25 }, 133 { x: 1000000, y: 50 }, 134 { x: 1000000, y: 0 }, 135 ], 136 ], 137 }, 138 { 139 targetClass: "no-compositor", 140 expectedIterationPathList: [ 141 [ 142 { x: 0, y: 0 }, 143 { x: 250000, y: 25 }, 144 { x: 500000, y: 50 }, 145 { x: 750000, y: 75 }, 146 { x: 1000000, y: 100 }, 147 { x: 1000000, y: 0 }, 148 ], 149 ], 150 }, 151 { 152 targetClass: "keyframes-easing-step", 153 expectedIterationPathList: [ 154 [ 155 { x: 0, y: 0 }, 156 { x: 499999, y: 0 }, 157 { x: 500000, y: 50 }, 158 { x: 999999, y: 50 }, 159 { x: 1000000, y: 0 }, 160 ], 161 ], 162 }, 163 { 164 targetClass: "narrow-keyframes", 165 expectedIterationPathList: [ 166 [ 167 { x: 0, y: 0 }, 168 { x: 100000, y: 10 }, 169 { x: 110000, y: 10 }, 170 { x: 115000, y: 10 }, 171 { x: 129999, y: 10 }, 172 { x: 130000, y: 13 }, 173 { x: 135000, y: 13.5 }, 174 ], 175 ], 176 }, 177 { 178 targetClass: "duplicate-offsets", 179 expectedIterationPathList: [ 180 [ 181 { x: 0, y: 0 }, 182 { x: 250000, y: 25 }, 183 { x: 500000, y: 50 }, 184 { x: 999999, y: 50 }, 185 ], 186 ], 187 }, 188 ]; 189 190 add_task(async function () { 191 await testComputedTimingPath(TEST_DATA); 192 });