blob: de517bf405c66e94e72f942de33ac6ab72807e2d [file] [log] [blame]
Yoav Weiss79001b12018-12-12 17:16:561<!DOCTYPE HTML>
2<html>
3<head onload>
4<meta charset="utf-8" />
5<title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title>
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:506<link rel="author" title="Google" href="http://www.google.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 t => {
16 addAssertUnreachedBufferFull(t);
17 await fillUpTheBufferWithSingleResource();
Yoav Weiss79001b12018-12-12 17:16:5618 // These resources overflow the entry buffer, and go into the secondary buffer.
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5019 load.xhr_sync(scriptResources[1]);
20 load.xhr_sync(scriptResources[2]);
21 // Immediately increase the size: the bufferfull event should not be fired.
Yoav Weiss79001b12018-12-12 17:16:5622 performance.setResourceTimingBufferSize(3);
Yoav Weiss79001b12018-12-12 17:16:5623 await waitForNextTask();
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5024 checkEntries(3);
Yoav Weiss79001b12018-12-12 17:16:5625}, "Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event");
26</script>
27</body>
28</html>