OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <link rel="help" href="https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/Resourc
eTiming/Overview.html#extensions-performance-interface"> |
| 4 <script src="../resources/js-test-pre.js"></script> |
| 5 <script> |
| 6 description("This test checks that Performance inherits EventTarget and that add
EventListener() works for resourcetimingbufferfull events."); |
| 7 window.jsTestIsAsync = true; |
| 8 var bufferFullCount = 0; |
| 9 var parameter; |
| 10 |
| 11 function onBufferFull(event) { |
| 12 parameter = event; |
| 13 shouldBe('parameter.__proto__', 'Event.prototype'); |
| 14 bufferFullCount++; |
| 15 } |
| 16 |
| 17 shouldBe('Performance.prototype.__proto__', 'EventTarget.prototype'); |
| 18 |
| 19 performance.webkitSetResourceTimingBufferSize(2); |
| 20 shouldBeNull('performance.onwebkitresourcetimingbufferfull'); |
| 21 performance.addEventListener('webkitresourcetimingbufferfull', onBufferFull); |
| 22 shouldBeNull('performance.onwebkitresourcetimingbufferfull'); |
| 23 </script> |
| 24 </head> |
| 25 <body> |
| 26 <script> |
| 27 function test() { |
| 28 // Make sure the onBufferFull callback was called exactly 1 time. |
| 29 shouldBe('bufferFullCount', '1'); |
| 30 performance.removeEventListener('webkitresourcetimingbufferfull', onBufferFu
ll); |
| 31 finishJSTest(); |
| 32 } |
| 33 |
| 34 window.onload = test; |
| 35 </script> |
| 36 <script src="../resources/js-test-post.js"></script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |