OLD | NEW |
1 /* This is the helper function to run transition tests: | 1 /* This is the helper function to run transition tests: |
2 | 2 |
3 Test page requirements: | 3 Test page requirements: |
4 - The body must contain an empty div with id "result" | 4 - The body must contain an empty div with id "result" |
5 - Call this function directly from the <script> inside the test page | 5 - Call this function directly from the <script> inside the test page |
6 | 6 |
7 Function parameters: | 7 Function parameters: |
8 expected [required]: an array of arrays defining a set of CSS properties tha
t must have given values at specific times (see below) | 8 expected [required]: an array of arrays defining a set of CSS properties tha
t must have given values at specific times (see below) |
9 callback [optional]: a function to be executed just before the test starts (
none by default) | 9 callback [optional]: a function to be executed just before the test starts (
none by default) |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 if (!property.indexOf("-webkit-transform.")) | 229 if (!property.indexOf("-webkit-transform.")) |
230 property = "-webkit-transform"; | 230 property = "-webkit-transform"; |
231 | 231 |
232 var tryToPauseTransition = expected[i][6]; | 232 var tryToPauseTransition = expected[i][6]; |
233 if (tryToPauseTransition === undefined) | 233 if (tryToPauseTransition === undefined) |
234 tryToPauseTransition = shouldBeTransitioning; | 234 tryToPauseTransition = shouldBeTransitioning; |
235 | 235 |
236 if (hasPauseTransitionAPI && usePauseAPI) { | 236 if (hasPauseTransitionAPI && usePauseAPI) { |
237 if (tryToPauseTransition) { | 237 if (tryToPauseTransition) { |
238 var element = document.getElementById(elementId); | 238 var element = document.getElementById(elementId); |
239 if (!internals.pauseTransitionAtTimeOnElement(property, time, elem
ent)) | 239 internals.pauseAnimations(time); |
240 window.console.log("Failed to pause '" + property + "' transitio
n on element '" + elementId + "'"); | |
241 } | 240 } |
242 checkExpectedValue(expected, i); | 241 checkExpectedValue(expected, i); |
243 } else { | 242 } else { |
244 if (time > maxTime) | 243 if (time > maxTime) |
245 maxTime = time; | 244 maxTime = time; |
246 | 245 |
247 window.setTimeout(checkExpectedValueCallback(expected, i), time * 10
00); | 246 window.setTimeout(checkExpectedValueCallback(expected, i), time * 10
00); |
248 } | 247 } |
249 } | 248 } |
250 | 249 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 if (!doPixelTest) | 286 if (!doPixelTest) |
288 testRunner.dumpAsText(); | 287 testRunner.dumpAsText(); |
289 testRunner.waitUntilDone(); | 288 testRunner.waitUntilDone(); |
290 } | 289 } |
291 | 290 |
292 if (!expected) | 291 if (!expected) |
293 throw("Expected results are missing!"); | 292 throw("Expected results are missing!"); |
294 | 293 |
295 window.addEventListener("load", function() { startTest(expected, usePauseAPI
, callback); }, false); | 294 window.addEventListener("load", function() { startTest(expected, usePauseAPI
, callback); }, false); |
296 } | 295 } |
OLD | NEW |