Bug 1452254 [wpt PR 8648] - PaymentRequest: Use [SecureContext] instead of manual check, a=testonly
authorBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Mon, 09 Apr 2018 18:06:46 +0000
changeset 467171 8adde208dda8b7eaeef79db59500611ae0c8f2e1
parent 467170 5fba803bc951c87a0a72ba60e0f55c33befde8f9
child 467172 fdaca2ea8a6fa572d788176044e343f72edb09a9
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
bugs1452254
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 1452254 [wpt PR 8648] - PaymentRequest: Use [SecureContext] instead of manual check, a=testonly Automatic update from web-platform-testsPaymentRequest: Use [SecureContext] instead of manual check (#8648) Until now, we had to use IsSecureContext() to check whether an execution context is a secure context manually. But we can use [SecureContext] instead of the manual check now. After this change, all related APIs including PaymentRequest will not be exposed in non-secure context. Bug: none Change-Id: Ie5b3fc6641e882cc2844595fea350b6adb3425db wpt-commits: a1ec330b943e4164962bd1108798d60aa4a0e5e3 wpt-pr: 8648 wpt-commits: a1ec330b943e4164962bd1108798d60aa4a0e5e3 wpt-pr: 8648
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/payment-request/payment-request-insecure.http.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -350942,16 +350942,22 @@
     ]
    ],
    "payment-request/payment-request-id-attribute.https.html": [
     [
      "/payment-request/payment-request-id-attribute.https.html",
      {}
     ]
    ],
+   "payment-request/payment-request-insecure.http.html": [
+    [
+     "/payment-request/payment-request-insecure.http.html",
+     {}
+    ]
+   ],
    "payment-request/payment-request-not-exposed.https.worker.js": [
     [
      "/payment-request/payment-request-not-exposed.https.worker.html",
      {}
     ]
    ],
    "payment-request/payment-request-onshippingaddresschange-attribute.https.html": [
     [
@@ -582667,16 +582673,20 @@
   "payment-request/payment-request-ctor-pmi-handling.https.html": [
    "f2372d7eea1cc49cd739ed4818c74cf9e5a39151",
    "testharness"
   ],
   "payment-request/payment-request-id-attribute.https.html": [
    "34dd889e8bc906eb9a99c192e547fab831099f7c",
    "testharness"
   ],
+  "payment-request/payment-request-insecure.http.html": [
+   "34452230c20571ef161fa237130faea57240f532",
+   "testharness"
+  ],
   "payment-request/payment-request-not-exposed.https.worker.js": [
    "b1c3cdc182cb967ec11b1cad826b333511203d77",
    "testharness"
   ],
   "payment-request/payment-request-onshippingaddresschange-attribute.https.html": [
    "c9e3679232a83abe6a9eefcb28e3387d2c7810e5",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/payment-request/payment-request-insecure.http.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
+<meta charset="utf-8">
+<title>Test for PaymentRequest Constructor (insecure)</title>
+<link rel="help" href="https://w3c.github.io/payment-request/#paymentrequest-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+  assert_false(isSecureContext);
+  assert_false("PaymentRequest" in window);
+}, "PaymentRequest constructor must not be exposed in insecure context");
+</script>