diff options
Diffstat (limited to 'testing/web-platform/tests/resource-timing/buffer-full-add-after-full-event.html')
-rw-r--r-- | testing/web-platform/tests/resource-timing/buffer-full-add-after-full-event.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/resource-timing/buffer-full-add-after-full-event.html b/testing/web-platform/tests/resource-timing/buffer-full-add-after-full-event.html new file mode 100644 index 0000000000..43dc3d84fd --- /dev/null +++ b/testing/web-platform/tests/resource-timing/buffer-full-add-after-full-event.html @@ -0,0 +1,27 @@ +<!DOCTYPE HTML> +<html> +<head> +<meta charset="utf-8"> +<link rel="author" title="Google" href="http://www.google.com/" /> +<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-setresourcetimingbuffersize"> +<title>This test validates that setResourceTimingBufferFull behaves appropriately when set to the current buffer level.</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/resource-loaders.js"></script> +<script src="resources/buffer-full-utilities.js"></script> +</head> +<body> +<script> +promise_test(async t => { + await forceBufferFullEvent(); + performance.clearResourceTimings(); + return new Promise(resolve => { + new PerformanceObserver(t.step_func(() => { + assert_equals(performance.getEntriesByType('resource').length, 1, + 'The entry should be available in the performance timeline!'); + resolve(); + })).observe({type: 'resource'}); + load.script(scriptResources[2]); + }); +}, "Test that entry was added to the buffer after a buffer full event"); +</script> |