Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../resources/js-test-pre.js"></script> | |
| 4 <script> | |
| 5 description("This test validates the functionality of onresourcetimingbufferfull in resource timing."); | |
| 6 jsTestIsAsync = true; | |
| 7 var bufferFullCount = 0; | |
| 8 var parameter; | |
| 9 | |
| 10 function onBufferFull(event) { | |
| 11 parameter = event; | |
| 12 // No parameter should be given as this is not an event. | |
| 13 shouldBeUndefined("parameter"); | |
| 14 bufferFullCount++; | |
|
arv (Not doing code reviews)
2013/07/09 18:19:58
Can you also assert that this === window.performan
| |
| 15 } | |
| 16 | |
| 17 performance.webkitSetResourceTimingBufferSize(2); | |
| 18 shouldBeNull('performance.onwebkitresourcetimingbufferfull'); | |
| 19 performance.onwebkitresourcetimingbufferfull = onBufferFull; | |
| 20 shouldBe('performance.onwebkitresourcetimingbufferfull', 'onBufferFull'); | |
| 21 </script> | |
| 22 </head> | |
| 23 <body onload="test()"> | |
| 24 <script> | |
| 25 function test() { | |
| 26 // Make sure the onBufferFull callback was called exactly 1 time. | |
| 27 shouldBe('bufferFullCount', '1'); | |
| 28 performance.onwebkitresourcetimingbufferfull = null; | |
| 29 shouldBeNull('performance.onwebkitresourcetimingbufferfull'); | |
| 30 finishJSTest(); | |
| 31 } | |
| 32 </script> | |
| 33 <script src="../resources/js-test-post.js"></script> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |