Bug 1514976 [wpt PR 14579] - SignedExchange: Redirect if served from a non secure origin, a=testonly
authorKouhei Ueno <kouhei@chromium.org>
Thu, 31 Jan 2019 12:12:11 +0000
changeset 457736 7bd509fe6140304b569da93ab39b77fb8e73cb18
parent 457735 193475ae0c882c5f3eba3313c0cd224519cde6eb
child 457737 f11dfd60fc19fab41a4eecf4d1140c76e661e680
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1514976, 14579, 915576, 1379791, 617467
milestone67.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 1514976 [wpt PR 14579] - SignedExchange: Redirect if served from a non secure origin, a=testonly Automatic update from web-platform-tests SignedExchange: Redirect if served from a non secure origin Before this CL, navigating to a sxg served over http triggered its download. This CL aligns the implementation to the loading spec [1] so that it will trigger redirect to the sxg's fallback url. [1] https://wicg.github.io/webpackage/loading.html#parsing-b1 Bug: 915576 Change-Id: I3b5dcf31b5e3a6d7c2287bcd8b8c7ad693b9d7e0 Reviewed-on: https://chromium-review.googlesource.com/c/1379791 Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#617467} -- wpt-commits: e0c16fd03b58fdbfdeddb9880db8910ace4c89de wpt-pr: 14579
testing/web-platform/tests/signed-exchange/sxg-non-secure-origin.tentative.html
--- a/testing/web-platform/tests/signed-exchange/sxg-non-secure-origin.tentative.html
+++ b/testing/web-platform/tests/signed-exchange/sxg-non-secure-origin.tentative.html
@@ -2,19 +2,16 @@
 <title>Loading SignedHTTPExchange from non secure origin must fail</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/common/get-host-info.sub.js"></script>
 <script src="./resources/sxg-util.js"></script>
 <body>
 <script>
 promise_test(async (t) => {
-  try {
-    const sxgUrl = get_host_info().HTTP_ORIGIN + '/signed-exchange/resources/sxg-location.sxg';
-    await openSXGInIframeAndWaitForMessage(t, sxgUrl);
-    assert_unreached('SXG should not have loaded');
-  } catch (e) {
-    assert_equals(e, 'timeout');
-  }
+  const sxgUrl = get_host_info().HTTP_ORIGIN + '/signed-exchange/resources/sxg-location.sxg';
+  const message = await openSXGInIframeAndWaitForMessage(t, sxgUrl);
+  assert_equals(message.location, innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
+  assert_true(message.is_fallback);
 }, 'Loading SignedHTTPExchange from non secure origin must fail');
 
 </script>
 </body>