| OLD | NEW |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | 1 <!DOCTYPE html> |
| 2 "http://www.w3.org/TR/html4/loose.dtd"> | |
| 3 | 2 |
| 4 <html lang="en"> | 3 <html lang="en"> |
| 5 <head> | 4 <head> |
| 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 7 <style> | 6 <style> |
| 8 | 7 |
| 9 body { | 8 body { |
| 10 margin: 0; | 9 margin: 0; |
| 11 } | 10 } |
| 12 | 11 |
| 13 #target { | 12 #target { |
| 14 position: relative; | 13 position: relative; |
| 15 top: 100px; | 14 top: 100px; |
| 16 left: 100px; | 15 left: 100px; |
| 17 width: 200px; | 16 width: 200px; |
| 18 height: 200px; | 17 height: 200px; |
| 19 background-color: red; | 18 background-color: red; |
| 20 -webkit-animation-name: anim1, anim2; | 19 -webkit-animation-name: anim1, anim2; |
| 21 -webkit-animation-duration: 2s, 2s; | 20 -webkit-animation-duration: 300ms, 300ms; |
| 22 -webkit-animation-delay: 0s, 1s; | 21 -webkit-animation-delay: 0s, 100ms; |
| 23 -webkit-transition-property: top, width; | 22 -webkit-transition-property: top, width; |
| 24 -webkit-transition-duration: 2s, 2s; | 23 -webkit-transition-duration: 300ms, 300ms; |
| 25 -webkit-transition-delay: 0s, 1s; | 24 -webkit-transition-delay: 0s, 100ms; |
| 26 } | 25 } |
| 27 | 26 |
| 28 @-webkit-keyframes anim1 { | 27 @-webkit-keyframes anim1 { |
| 29 from { | 28 from { |
| 30 left: 100px; | 29 left: 100px; |
| 31 opacity: 1.0; | 30 opacity: 1.0; |
| 32 } | 31 } |
| 33 to { | 32 to { |
| 34 left: 200px; | 33 left: 200px; |
| 35 opacity: 0.0; | 34 opacity: 0.0; |
| 36 } | 35 } |
| 37 } | 36 } |
| 38 | 37 |
| 39 @-webkit-keyframes anim2 { | 38 @-webkit-keyframes anim2 { |
| 40 from { | 39 from { |
| 41 height: 200px; | 40 height: 200px; |
| 42 } | 41 } |
| 43 to { | 42 to { |
| 44 height: 50px; | 43 height: 50px; |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 </style> | 47 </style> |
| 49 <script type="text/javascript" charset="utf-8"> | 48 <script type="text/javascript" charset="utf-8"> |
| 50 | 49 |
| 51 function sample0() { | 50 function sample(time, expected, isLast) { |
| 52 var expected = 4; | |
| 53 var current = internals.numberOfActiveAnimations(); | 51 var current = internals.numberOfActiveAnimations(); |
| 54 if (current == expected) | 52 if (current == expected) |
| 55 document.getElementById('result0').innerHTML = "Number of active animati
ons at 0s is (" + current + ") as expected"; | 53 document.getElementById('result').innerHTML += "PASS: Number of active a
nimations at " + time + "ms is (" + current + ") as expected<br>"; |
| 56 else | 54 else |
| 57 document.getElementById('result0').innerHTML = "Number of active animati
ons at 0s is (" + current + ") but was expecting (" + expected + ")"; | 55 document.getElementById('result').innerHTML += "FAIL: Number of active a
nimations at " + time + "ms is (" + current + ") but was expecting (" + expected
+ ")<br>"; |
| 58 } | 56 if (isLast) |
| 59 | 57 testRunner.notifyDone(); |
| 60 function sample1() { | |
| 61 var expected = 4; | |
| 62 var current = internals.numberOfActiveAnimations(); | |
| 63 if (current == expected) | |
| 64 document.getElementById('result1').innerHTML = "Number of active animati
ons at 1s is (" + current + ") as expected"; | |
| 65 else | |
| 66 document.getElementById('result1').innerHTML = "Number of active animati
ons at 1s is (" + current + ") but was expecting (" + expected + ")"; | |
| 67 | |
| 68 testRunner.notifyDone(); | |
| 69 } | 58 } |
| 70 | 59 |
| 71 function startTest() { | 60 function startTest() { |
| 72 if (window.testRunner) { | 61 if (window.testRunner) { |
| 73 testRunner.dumpAsText(); | 62 testRunner.dumpAsText(); |
| 74 testRunner.waitUntilDone(); | 63 testRunner.waitUntilDone(); |
| 75 | 64 |
| 76 var target = document.getElementById('target'); | 65 var target = document.getElementById('target'); |
| 77 target.style.top = '200px'; | 66 target.style.top = '200px'; |
| 78 target.style.width = '100px'; | 67 target.style.width = '100px'; |
| 79 | 68 |
| 80 window.setTimeout(sample0, 0); | 69 setTimeout(sample.bind(null, 0, 4, false), 0); |
| 81 window.setTimeout(sample1, 1100); | 70 setTimeout(sample.bind(null, 200, 4, false), 200); |
| 71 setTimeout(sample.bind(null, 500, 0, true), 500); |
| 82 } | 72 } |
| 83 } | 73 } |
| 84 | 74 |
| 85 </script> | 75 </script> |
| 86 </head> | 76 </head> |
| 87 <body onload="startTest()"> | 77 <body onload="startTest()"> |
| 88 <h1>Test for DRT numberOfActiveAnimations() API</h1> | 78 <h1>Test for DRT numberOfActiveAnimations() API</h1> |
| 89 | 79 |
| 90 <div id="target"> | 80 <div id="target"></div> |
| 91 </div> | 81 <div id="result"></div> |
| 92 | |
| 93 <div id="result0"> | |
| 94 </div> | |
| 95 | |
| 96 <div id="result1"> | |
| 97 </div> | |
| 98 | |
| 99 </body> | 82 </body> |
| 100 </html> | 83 </html> |
| OLD | NEW |