Revision 83be7773ed3e2df8c2f8625d11ec35358586e48c authored by Anne van Kesteren on 13 March 2018, 17:31:34 UTC, committed by Anne van Kesteren on 13 March 2018, 17:31:34 UTC
See https://github.com/whatwg/html/pull/3562.
1 parent 970fca8
Raw File
resource_frame_initiator_type.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing frame initiator type</title>
<link rel="author" title="Google" href="http://www.google.com/" />
<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>
<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>
setup({explicit_done: true});

function onload_test() {
    const iframe = document.getElementById('frameContext');
    const context = new PerformanceContext(iframe.contentWindow.performance);
    const entries = context.getEntriesByType('resource');

    const index = window.location.pathname.lastIndexOf('/');
    const pathname = window.location.pathname.substring(0, index) +
      '/resources/blank_page_green.htm';
    const expected_entries = {};
    expected_entries[pathname] = 'frame';

    test_resource_entries(entries, expected_entries);
    done();
}
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that the frame initiator type is represented.</p>
<div id="log"></div>
<iframe id="frameContext" onload="onload_test();" src="resources/green_frame.htm" style="width: 250px; height: 250px;"></iframe>
</body>
</html>
back to top