<!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>
