blob: d5883d33d5d780708a11167731cd7070f0105edb [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>
Yoav Weiss79001b12018-12-12 17:16:5615promise_test(async () => {
Nicolás Peña Moreno8a1c14c2021-05-27 22:27:5016 await fillUpTheBufferWithSingleResource();
17 performance.addEventListener('resourcetimingbufferfull', () => {
18 performance.setResourceTimingBufferSize(3);
19 load.xhr_sync(scriptResources[2]);
20 });
21 // This resource overflows the entry buffer, and goes into the secondary buffer.
22 load.script(scriptResources[1]);
23 await bufferFullFirePromise;
24 checkEntries(3);
Yoav Weiss79001b12018-12-12 17:16:5625}, "Test that entries synchronously added to the buffer during the callback don't get dropped if the buffer is increased");
26</script>
27</body>
28</html>