Bug 1449645 [wpt PR 10213] - Tests and docs for the current CORB vs <link rel="preload"> behavior., a=testonly
authorLukasz Anforowicz <lukasza@chromium.org>
Mon, 09 Apr 2018 21:30:14 +0000
changeset 467245 97571ebc17d6fb76520bfe0b1bca2b0ff165976c
parent 467244 25e91d9ab4e9b9516fbabd0e05bccc3c76f7c0b1
child 467246 56eb91b7cc04f0057364eb216fd09fee081ea1bb
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1449645, 10213, 809261, 984338, 547494
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1449645 [wpt PR 10213] - Tests and docs for the current CORB vs <link rel="preload"> behavior., a=testonly Automatic update from web-platform-testsTests and docs for the current CORB vs <link rel="preload"> behavior. Bug: 809261 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo Change-Id: Idafb2b4cc5da3d6c7a054e479745288cc3b86513 Reviewed-on: https://chromium-review.googlesource.com/984338 Commit-Queue: Ɓukasz Anforowicz <lukasza@chromium.org> Reviewed-by: Nick Carter <nick@chromium.org> Cr-Commit-Position: refs/heads/master@{#547494} wpt-commits: 4bb4e6ec3e5abe394a69e79c0d6df160b606e6f4 wpt-pr: 10213 wpt-commits: 4bb4e6ec3e5abe394a69e79c0d6df160b606e6f4 wpt-pr: 10213
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -326633,16 +326633,22 @@
     ]
    ],
    "fetch/api/response/response-trailer.html": [
     [
      "/fetch/api/response/response-trailer.html",
      {}
     ]
    ],
+   "fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html": [
+    [
+     "/fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html",
+     {}
+    ]
+   ],
    "fetch/corb/script-html-correctly-labeled.tentative.sub.html": [
     [
      "/fetch/corb/script-html-correctly-labeled.tentative.sub.html",
      {}
     ]
    ],
    "fetch/corb/script-html-via-cross-origin-blob-url.sub.html": [
     [
@@ -552776,16 +552782,20 @@
   "fetch/corb/img-png-mislabeled-as-html.sub-expected.html": [
    "730878950e0b7a4097d42e7eaaae79304fe05106",
    "support"
   ],
   "fetch/corb/img-png-mislabeled-as-html.sub.html": [
    "a7775fb534d38a5d5b5827a27f0c16e1268f4d0b",
    "reftest"
   ],
+  "fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html": [
+   "e3d5ad8b15d2b206fc49090ec9a1d1bb3fa13242",
+   "testharness"
+  ],
   "fetch/corb/resources/css-mislabeled-as-html-nosniff.css": [
    "7d3f1614c6d0170f67442ee60fe2aab6099bedc1",
    "support"
   ],
   "fetch/corb/resources/css-mislabeled-as-html-nosniff.css.headers": [
    "1bea535d497ae73eb7a84d3a14a5276e9d0ccc34",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/preload-image-png-mislabeled-as-html-nosniff.tentative.sub.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!-- This test verifies observable CORB impact on <link rel="preload"> elements.
+-->
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+
+<script>
+async_test(function(t) {
+  // With CORB the link.onerror event will be reached
+  // (because CORB will block the cross-origin preload).
+  window.preloadErrorEvent = t.step_func_done();
+
+  // Without CORB the link.onload event will be reached.
+  window.preloadLoadEvent = t.unreached_func("link/preload onload event reached.");
+});
+</script>
+
+<!-- www1 is cross-origin, so the HTTP response is CORB-eligible -->
+<link rel="preload" as="image"
+      onerror="window.preloadErrorEvent()"
+      onload="window.preloadLoadEvent()"
+      href="http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/png-mislabeled-as-html-nosniff.png">