Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / webtiming-buffer-full-no-event.html
bloba36a8dd4f8f8acfcd40f88f2939919740b1fd0d5
1 <html>
2 <head>
3 <link rel="help" href="https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html#extensions-performance-interface">
4 <script src="/js-test-resources/js-test.js"></script>
5 <script>
6 description("This test checks that Performance inherits EventTarget and that addEventListener() works for resourcetimingbufferfull events.");
7 window.jsTestIsAsync = true;
8 var bufferFullCount = 0;
9 var parameter;
11 function onBufferFull(event) {
12 shouldBeNull('performance.onresourcetimingbufferfull');
13 parameter = event;
14 shouldBe('parameter.__proto__', 'Event.prototype');
15 bufferFullCount++;
18 shouldBe('Performance.prototype.__proto__', 'EventTarget.prototype');
20 performance.addEventListener('resourcetimingbufferfull', onBufferFull);
21 shouldBeNull('performance.onresourcetimingbufferfull');
22 performance.setResourceTimingBufferSize(2);
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('resourcetimingbufferfull', onBufferFull);
31 finishJSTest();
34 window.onload = test;
35 </script>
36 <script src="resources/empty-script.js"></script>
37 </body>
38 </html>