Commit c41d8767 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@16c953fc379c1409856b7c70efa4adb79e4be4b1

Using wpt-import in Chromium 77c07678.
With Chromium commits locally applied on WPT:
398ba6bd "service worker: Add WPT tests for resultingClientId."
0d8287d0 "Revert "service worker: Add WPT tests for resultingClientId.""


Build: https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/25319

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

NOAUTOREVERT=true
TBR=lukebjerring

No-Export: true
Change-Id: I777a66dde5347825daaf231165c1dd5e22813f5f
Reviewed-on: https://chromium-review.googlesource.com/1245681
Commit-Queue: Blink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Reviewed-by: default avatarBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594298}
parent 703f0c8d
This is a testharness.js-based test.
PASS Should get an error event for a 404 error.
PASS Should get an error event for an unsupported URL.
FAIL Should get an error event for a text/plain response. assert_unreached: load event should not be fired Reached unreachable code
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and nosniff
FAIL Stylesheet loading using <link> with wrong Content-Type, same-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using <link> with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and nosniff
FAIL Stylesheet loading using @import with wrong Content-Type, same-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using @import with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and nosniff
Harness: the test ran to completion.
......@@ -4,6 +4,7 @@
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=/common/get-host-info.sub.js></script>
<div id="log"></div>
<div id="test">
<script>
......@@ -31,18 +32,6 @@ tUnsupported.step(function() {
elt.rel = "stylesheet";
elt.href = "nonexistent:stylesheet.css";
document.getElementsByTagName("head")[0].appendChild(elt);
})
var tText = async_test("Should get an error event for a text/plain response.")
tText.step(function() {
var elt = document.createElement("link");
elt.onerror = tText.step_func(function() {
assert_true(true, "Got error event for 404 error.")
tText.done()
})
elt.onload = tText.unreached_func("load event should not be fired");
elt.rel = "stylesheet";
elt.href = "../../../../../common/css-red.txt";
document.getElementsByTagName("head")[0].appendChild(elt);
})
});
</script>
<script src=resources/link-style-error.js></script>
This is a testharness.js-based test.
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with wrong Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with wrong Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and nosniff
Harness: the test ran to completion.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//" "">
<title>link: error events in limited quirks mode</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=/common/get-host-info.sub.js></script>
<div id="log"></div>
<script src=resources/link-style-error.js></script>
This is a testharness.js-based test.
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with wrong Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using <link> with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using <link> with broken Content-Type, cross-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with wrong Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with wrong Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, same-origin, and nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with no Content-Type, cross-origin, and nosniff
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and no nosniff assert_unreached: error event should have fired Reached unreachable code
FAIL Stylesheet loading using @import with wrong Content-Type, cross-origin, and nosniff assert_unreached: error event should have fired Reached unreachable code
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and no nosniff
PASS Stylesheet loading using @import with broken Content-Type, cross-origin, and nosniff
Harness: the test ran to completion.
<!DOCTYPE HTML PUBLIC "-//Sun Microsystems Corp.//DTD HotJava Strict HTML//" "">
<title>link: error events in quirks mode</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=/common/get-host-info.sub.js></script>
<div id="log"></div>
<script src=resources/link-style-error.js></script>
def main(request, response):
response.add_required_headers = False
if "content_type" in request.GET:
response.writer.write_header("Content-Type", request.GET.first("content_type"))
if "nosniff" in request.GET:
response.writer.write_header("x-content-type-options", "nosniff")
response.writer.write_content("body { background:red }")
["<link>", "@import"].forEach(linkType => {
[
["same-origin", "resources/css.py"],
["cross-origin", get_host_info().HTTP_REMOTE_ORIGIN + "/html/semantics/document-metadata/the-link-element/resources/css.py"]
].forEach(originType => {
["no Content-Type", "wrong Content-Type", "broken Content-Type"].forEach(contentType => {
["no nosniff", "nosniff"].forEach(nosniff => {
async_test(t => {
const l = document.createElement("link");
t.add_cleanup(() => l.remove());
if (nosniff === "nosniff" || contentType === "wrong Content-Type" && (document.compatMode === "CSS1Compat" || originType[0] === "cross-origin")) {
l.onerror = t.step_func_done();
l.onload = t.unreached_func("error event should have fired");
} else {
l.onload = t.step_func_done();
l.onerror = t.unreached_func("load event should have fired");
}
l.rel = "stylesheet";
let query = [];
if (contentType === "broken Content-Type") {
query.push("content_type=oops");
} else if (contentType === "wrong Content-Type") {
query.push("content_type=text/plain")
}
if (nosniff === "nosniff") {
query.push("nosniff");
}
let stringQuery = "";
query.forEach(val => {
if (stringQuery === "") {
stringQuery += "?" + val;
} else {
stringQuery += "&" + val;
}
});
const link = new URL(originType[1] + stringQuery, location).href;
if (linkType === "<link>") {
l.href = link;
} else {
l.href = "data:text/css,@import url(" + link + ");";
}
document.head.appendChild(l);
}, "Stylesheet loading using " + linkType + " with " + contentType + ", " + originType[0] + ", and " + nosniff);
});
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment