https://github.com/web-platform-tests/wpt
Revision f61fc86b7b84666c103648d5c798322bfcc3f239 authored by James Graham on 29 January 2018, 11:46:51 UTC, committed by jgraham on 25 April 2018, 18:25:55 UTC
This is a docker image based on the Ubuntu1604 base, with the runtime
deps of Firefox and Chrome installed. There is also a shallow clone of
wpt to act as a placeholder. The start.sh script will update this
clone and start Xvfb, so it's possible to run tests.
1 parent b6fc6d7
Raw File
Tip revision: f61fc86b7b84666c103648d5c798322bfcc3f239 authored by James Graham on 29 January 2018, 11:46:51 UTC
Add a docker image designed for running tests.
Tip revision: f61fc86
resource_timing_cross_origin_redirect_chain.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>This test validates resource timing information for a cross-origin redirect chain.</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>
    setup({explicit_done: true});
    test_namespace('getEntriesByName');
    const pageOrigin = document.location.host;
    const crossOrigin = 'www.' + pageOrigin;

    function onload_test()
    {
        const context = new PerformanceContext(performance);
        const entries = context.getEntriesByName(document.getElementById('frameContext').src, 'resource');
        test_equals(entries.length, 1, 'There should be one entry.');
        const entry = entries[0];

        test_equals(entry.redirectStart, 0, 'redirectStart == 0 in cross-origin redirect.');
        test_equals(entry.redirectEnd, 0, 'redirectEnd == 0 in cross-origin redirect.');
        test_greater_than(entry.fetchStart, 0, 'fetchStart > 0 in cross-origin redirect.');
        test_equals(entry.startTime, entry.fetchStart, 'startTime == fetchStart in cross-origin redirect.');
        done();
    }
</script>

</head>
<body>
<iframe id="frameContext" src="" style="width: 250px; height: 250px;"></iframe>
<script>
    let destUrl = 'http://' + crossOrigin + '/resource-timing/resources/multi_redirect.py?';
    destUrl += 'page_origin=' + 'http://' + pageOrigin;
    destUrl += '&cross_origin=' + 'http://' + crossOrigin;
    const frameContext = document.getElementById('frameContext');
    frameContext.onload = onload_test;
    frameContext.src = destUrl;
</script>
</body>
</html>
back to top