browser_animation_summary-graph_computed-timing-path_1.js (4672B)
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: "cssanimation-normal", 22 expectedIterationPathList: [ 23 [ 24 { x: 0, y: 0 }, 25 { x: 250000, y: 40.851 }, 26 { x: 500000, y: 80.24 }, 27 { x: 750000, y: 96.05 }, 28 { x: 1000000, y: 100 }, 29 { x: 1000000, y: 0 }, 30 ], 31 ], 32 }, 33 { 34 targetClass: "cssanimation-linear", 35 expectedIterationPathList: [ 36 [ 37 { x: 0, y: 0 }, 38 { x: 250000, y: 25 }, 39 { x: 500000, y: 50 }, 40 { x: 750000, y: 75 }, 41 { x: 1000000, y: 100 }, 42 { x: 1000000, y: 0 }, 43 ], 44 ], 45 }, 46 { 47 targetClass: "delay-positive", 48 expectedDelayPath: [ 49 { x: 0, y: 0 }, 50 { x: 500000, y: 0 }, 51 ], 52 expectedIterationPathList: [ 53 [ 54 { x: 500000, y: 0 }, 55 { x: 750000, y: 25 }, 56 { x: 1000000, y: 50 }, 57 { x: 1250000, y: 75 }, 58 { x: 1500000, y: 100 }, 59 { x: 1500000, y: 0 }, 60 ], 61 ], 62 }, 63 { 64 targetClass: "easing-step", 65 expectedIterationPathList: [ 66 [ 67 { x: 0, y: 0 }, 68 { x: 499999, y: 0 }, 69 { x: 500000, y: 50 }, 70 { x: 999999, y: 50 }, 71 { x: 1000000, y: 0 }, 72 ], 73 ], 74 }, 75 { 76 targetClass: "enddelay-positive", 77 expectedIterationPathList: [ 78 [ 79 { x: 0, y: 0 }, 80 { x: 250000, y: 25 }, 81 { x: 500000, y: 50 }, 82 { x: 750000, y: 75 }, 83 { x: 1000000, y: 100 }, 84 { x: 1000000, y: 0 }, 85 ], 86 ], 87 expectedEndDelayPath: [ 88 { x: 1000000, y: 0 }, 89 { x: 1500000, y: 0 }, 90 ], 91 }, 92 { 93 targetClass: "enddelay-negative", 94 expectedIterationPathList: [ 95 [ 96 { x: 0, y: 0 }, 97 { x: 250000, y: 25 }, 98 { x: 500000, y: 50 }, 99 { x: 500000, y: 0 }, 100 ], 101 ], 102 }, 103 { 104 targetClass: "enddelay-with-fill-forwards", 105 expectedIterationPathList: [ 106 [ 107 { x: 0, y: 0 }, 108 { x: 250000, y: 25 }, 109 { x: 500000, y: 50 }, 110 { x: 750000, y: 75 }, 111 { x: 1000000, y: 100 }, 112 { x: 1000000, y: 0 }, 113 ], 114 ], 115 expectedEndDelayPath: [ 116 { x: 1000000, y: 0 }, 117 { x: 1000000, y: 100 }, 118 { x: 1500000, y: 100 }, 119 { x: 1500000, y: 0 }, 120 ], 121 expectedForwardsPath: [ 122 { x: 1500000, y: 0 }, 123 { x: 1500000, y: 100 }, 124 ], 125 }, 126 { 127 targetClass: "enddelay-with-iterations-infinity", 128 expectedIterationPathList: [ 129 [ 130 { x: 0, y: 0 }, 131 { x: 250000, y: 25 }, 132 { x: 500000, y: 50 }, 133 { x: 750000, y: 75 }, 134 { x: 1000000, y: 100 }, 135 { x: 1000000, y: 0 }, 136 ], 137 [ 138 { x: 1000000, y: 0 }, 139 { x: 1250000, y: 25 }, 140 { x: 1500000, y: 50 }, 141 ], 142 ], 143 isInfinity: true, 144 }, 145 { 146 targetClass: "direction-alternate-with-iterations-infinity", 147 expectedIterationPathList: [ 148 [ 149 { x: 0, y: 0 }, 150 { x: 250000, y: 25 }, 151 { x: 500000, y: 50 }, 152 { x: 750000, y: 75 }, 153 { x: 1000000, y: 100 }, 154 { x: 1000000, y: 0 }, 155 ], 156 [ 157 { x: 1000000, y: 0 }, 158 { x: 1000000, y: 100 }, 159 { x: 1250000, y: 75 }, 160 { x: 1500000, y: 50 }, 161 ], 162 ], 163 isInfinity: true, 164 }, 165 { 166 targetClass: "direction-alternate-reverse-with-iterations-infinity", 167 expectedIterationPathList: [ 168 [ 169 { x: 0, y: 0 }, 170 { x: 0, y: 100 }, 171 { x: 250000, y: 75 }, 172 { x: 500000, y: 50 }, 173 { x: 750000, y: 25 }, 174 { x: 1000000, y: 0 }, 175 ], 176 [ 177 { x: 1000000, y: 0 }, 178 { x: 1250000, y: 25 }, 179 { x: 1500000, y: 50 }, 180 ], 181 ], 182 isInfinity: true, 183 }, 184 { 185 targetClass: "direction-reverse-with-iterations-infinity", 186 expectedIterationPathList: [ 187 [ 188 { x: 0, y: 0 }, 189 { x: 0, y: 100 }, 190 { x: 250000, y: 75 }, 191 { x: 500000, y: 50 }, 192 { x: 750000, y: 25 }, 193 { x: 1000000, y: 0 }, 194 ], 195 [ 196 { x: 1000000, y: 0 }, 197 { x: 1000000, y: 100 }, 198 { x: 1250000, y: 75 }, 199 { x: 1500000, y: 50 }, 200 ], 201 ], 202 isInfinity: true, 203 }, 204 ]; 205 206 add_task(async function () { 207 await testComputedTimingPath(TEST_DATA); 208 });