| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function startAnimation() | 6 function startAnimation() |
| 7 { | 7 { |
| 8 node.animate([{ width: "100px" }, { width: "200px" }], { duration: 200, dela
y: 100 }); | 8 node.animate([{ width: "100px" }, { width: "200px" }], { duration: 200, dela
y: 100 }); |
| 9 } | 9 } |
| 10 | 10 |
| 11 function startAnimationWithNegativeStartTime() | 11 function startAnimationWithNegativeStartTime() |
| 12 { | 12 { |
| 13 animation = node.animate([{ width: "100px" }, { width: "200px" }], { duratio
n: 20000, delay: 100, endDelay: 200 }); | 13 animation = node.animate([{ width: "100px" }, { width: "200px" }], { duratio
n: 20000, delay: 100, endDelay: 200 }); |
| 14 animation.startTime = -10000; | 14 animation.startTime = -10000; |
| 15 } | 15 } |
| 16 | 16 |
| 17 var initialize_Animations = function() { | 17 var initialize_Animations = function() { |
| 18 | 18 |
| 19 InspectorTest.preloadModule("animation"); | 19 InspectorTest.preloadModule("animation"); |
| 20 } | 20 } |
| 21 | 21 |
| 22 function test() | 22 function test() |
| 23 { | 23 { |
| 24 // Override timeline width for testing | 24 // Override timeline width for testing |
| 25 WebInspector.AnimationTimeline.prototype.width = function() { return 50; } | 25 WebInspector.AnimationTimeline.prototype.width = function() { return 50; } |
| 26 // Override animation color for testing | 26 // Override animation color for testing |
| 27 // FIXME: Set animation name of Web Animation instead; not supported yet | 27 // FIXME: Set animation name of Web Animation instead; not supported yet |
| 28 WebInspector.AnimationUI.Color = function() { return "black"; } | 28 WebInspector.AnimationUI.Color = function() { return "black"; } |
| 29 var timeline; | 29 |
| 30 InspectorTest.addSniffer(WebInspector.TabbedPane.prototype, "changeTabView",
onChangeTabView, true); | |
| 31 WebInspector.viewManager.showView("animations"); | 30 WebInspector.viewManager.showView("animations"); |
| 32 | 31 var timeline = self.runtime.sharedInstance(WebInspector.AnimationTimeline); |
| 33 function onChangeTabView(id, view) | 32 InspectorTest.evaluateInPage("startAnimation()"); |
| 34 { | 33 InspectorTest.waitForAnimationAdded(step2); |
| 35 if (!timeline && id === "animations") { | |
| 36 timeline = view; | |
| 37 InspectorTest.assertTrue(timeline instanceof WebInspector.AnimationT
imeline); | |
| 38 InspectorTest.waitForAnimationAdded(step2); | |
| 39 InspectorTest.evaluateInPage("startAnimation()"); | |
| 40 } | |
| 41 } | |
| 42 | 34 |
| 43 function step2(group) | 35 function step2(group) |
| 44 { | 36 { |
| 45 InspectorTest.addResult(timeline._groupBuffer.indexOf(group) !== -1); | 37 InspectorTest.addResult(timeline._groupBuffer.indexOf(group) !== -1); |
| 46 InspectorTest.waitForAnimationAdded(step3); | 38 InspectorTest.waitForAnimationAdded(step3); |
| 47 InspectorTest.evaluateInPage("startAnimationWithNegativeStartTime()"); | 39 InspectorTest.evaluateInPage("startAnimationWithNegativeStartTime()"); |
| 48 } | 40 } |
| 49 | 41 |
| 50 function step3(group) | 42 function step3(group) |
| 51 { | 43 { |
| 52 InspectorTest.addResult(timeline._groupBuffer.indexOf(group) !== -1); | 44 InspectorTest.addResult(timeline._groupBuffer.indexOf(group) !== -1); |
| 53 InspectorTest.completeTest(); | 45 InspectorTest.completeTest(); |
| 54 } | 46 } |
| 55 } | 47 } |
| 56 | 48 |
| 57 </script> | 49 </script> |
| 58 </head> | 50 </head> |
| 59 | 51 |
| 60 <body onload="runTest()"> | 52 <body onload="runTest()"> |
| 61 <p> | 53 <p> |
| 62 Tests that animation with negative start delay gets added. | 54 Tests that animation with negative start delay gets added. |
| 63 </p> | 55 </p> |
| 64 | 56 |
| 65 <div id="node" style="background-color: red; height: 100px"></div> | 57 <div id="node" style="background-color: red; height: 100px"></div> |
| 66 | 58 |
| 67 </body> | 59 </body> |
| 68 </html> | 60 </html> |
| OLD | NEW |