Revision df2e8038d83a8573de683c38fde2211bcc3057a2 authored by Luke Bjerring on 22 March 2018, 19:15:29 UTC, committed by GitHub on 22 March 2018, 19:15:29 UTC
1 parent e48a42f
Raw File
resource_timing_buffer_full_when_shrink_buffer_size.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script>
<script src="resources/webperftestharnessextension.js"></script>
<script>
    const context = new PerformanceContext(performance);
    let bufferFullCount = 0;
    function buffer_full_call_back() {
        bufferFullCount++;
    }
    context.registerResourceTimingBufferFullCallback(buffer_full_call_back);
    setup({ explicit_done: true });
    function onload_test() {
        context.setResourceTimingBufferSize(3);
        context.setResourceTimingBufferSize(0);
        test_equals(context.getEntriesByType('resource').length, 4, 'There are 4 scripts, and setResourceTimingBufferSize does not reduce the size.');
        test_equals(bufferFullCount, 0, 'onresourcetimingbufferfull should not be invoked during setResourceTimingBufferSize.');
        done();
    }
</script>
</head>
<body onload=onload_test()>
</body>
</html>
back to top