blob: f4b1a2e7e7abba25c78e4c1dbe0b1aba29061d47 [file] [log] [blame]
Yoav Weiss79001b12018-12-12 17:16:561<!DOCTYPE HTML>
2<html>
3<head>
4<meta charset="utf-8" />
Yoav Weiss79001b12018-12-12 17:16:565<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title>
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:506<link rel="author" title="Intel" href="http://www.intel.com/" />
7<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull"/>
Yoav Weiss79001b12018-12-12 17:16:568<script src="/resources/testharness.js"></script>
9<script src="/resources/testharnessreport.js"></script>
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5010<script src="resources/resource-loaders.js"></script>
Yoav Weiss79001b12018-12-12 17:16:5611<script src="resources/buffer-full-utilities.js"></script>
12</head>
13<body>
14<script>
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5015promise_test(async () => {
16 let bufferFullCount = 0;
Yoav Weiss79001b12018-12-12 17:16:5617 performance.addEventListener('resourcetimingbufferfull', e => {
18 assert_equals(e.bubbles, false, "Event bubbles attribute is false");
19 bufferFullCount++;
Yoav Weiss79001b12018-12-12 17:16:5620 });
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5021 await fillUpTheBufferWithTwoResources();
22 // Overflow the buffer
23 await load.script(scriptResources[2]);
24 await waitForNextTask();
25 checkEntries(2);
Yoav Weiss79001b12018-12-12 17:16:5626 assert_equals(bufferFullCount, 1, 'onresourcetimingbufferfull should have been invoked once.');
Yoav Weiss79001b12018-12-12 17:16:5627}, "Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow");
28</script>
29</body>
30</html>