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 456834 b20bd9c4080eec65b524cd07131fbf19fb764e69
parent 456833 d8712ec1c046f3a8ad8707566590d21da9b00b51
child 456835 54f4c87786a808c856f7e60c8a023a7fac5ad453
push id35505
push usercsabou@mozilla.com
push dateTue, 05 Feb 2019 21:59:22 +0000
treeherdermozilla-central@476293c6700f [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>