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>
6 description("This test checks that Performance inherits EventTarget and that addEventListener() works for resourcetimingbufferfull events.");
7 window
.jsTestIsAsync
= true;
8 var bufferFullCount
= 0;
11 function onBufferFull(event
) {
12 shouldBeNull('performance.onresourcetimingbufferfull');
14 shouldBe('parameter.__proto__', 'Event.prototype');
18 shouldBe('Performance.prototype.__proto__', 'EventTarget.prototype');
20 performance
.addEventListener('resourcetimingbufferfull', onBufferFull
);
21 shouldBeNull('performance.onresourcetimingbufferfull');
22 performance
.setResourceTimingBufferSize(2);
28 // Make sure the onBufferFull callback was called exactly 1 time.
29 shouldBe('bufferFullCount', '1');
30 performance
.removeEventListener('resourcetimingbufferfull', onBufferFull
);
36 <script src=
"resources/empty-script.js"></script>