Revision 9936e8c644dfcfc1c02ba53fa26c501d64eccc11 authored by Yutaka Hirano on 21 November 2017, 10:42:44 UTC, committed by Chromium WPT Sync on 21 November 2017, 10:42:44 UTC
This CL introduces a mime type parser and stringifier to
wpt/XMLHttpRequest/send-content-type-charset in order to accept
implementations that are actually conforming to the spec but were rejected
by the test due to some text representation errors.

Bug: https://github.com/whatwg/mimesniff/issues/39
Change-Id: I99466e2e596bb9c1b7f11267ad4ff0a886913086
1 parent 93f495e
Raw File
resource_TAO_origin_uppercase.htm
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing TAO tests</title>
<link rel="author" title="Google" href="http://www.google.com/" />
<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#timing-allow-origin"/>
<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});

// explicitly test the namespace before we start testing
test_namespace("getEntriesByType");

var d;
var iframe;
var iframeBody;
var image;
var random = Math.random();

function setup_iframe() {
    iframe = document.getElementById('frameContext');
    d = iframe.contentWindow.document;
    iframeBody = d.body;
    iframe.addEventListener('load', onload_test, false);
}
function onload_test() {
    if (window.performance.getEntriesByType === undefined) {
      done();
      return;
    }
    var context = new PerformanceContext(iframe.contentWindow.performance);
    var entries = context.getEntriesByType('resource');

    if(entries.length > 0) {
        entry = entries[0];

        test_equals((entry.redirectStart + entry.redirectEnd + entry.domainLookupStart + entry.domainLookupEnd + entry.connectStart + entry.connectEnd + entry.secureConnectionStart + entry.requestStart + entry.responseStart), 0, 'redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, connectEnd, secureConnectionStart, requestStart, and responseStart -- should be all returned as 0 when the value of Timing-Allow-Origin is NOT a case-sensitive match for the value of the origin of the current document and TAO algorithm passes');
    }

    done();
}
window.setup_iframe = setup_iframe;
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that for a cross origin resource, the timing allow check algorithm will fail when the value of Timing-Allow-Origin is NOT a case-sensitive match for the value of the origin of the current document.</p>
<div id="log"></div>
<iframe id="frameContext" src="resources/iframe_TAO_origin_uppercase.html"></iframe>
</body>
</html>
back to top