Bug 1452251 [wpt PR 9966] - [presentation-api] check if a URL with an unsupported scheme is ignored, a=testonly
authorTomoyuki Shimizu <tomoyuki.labs@gmail.com>
Mon, 09 Apr 2018 17:12:09 +0000
changeset 467096 7b6feb16ae6fe5ee0889b819b649b2b41e003893
parent 467095 590c56a579b8a46841bd171e119bbe292a2cec22
child 467097 6480d1e82ebf41d98d7c2ad8a18cb958201e5ae4
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
bugs1452251
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 1452251 [wpt PR 9966] - [presentation-api] check if a URL with an unsupported scheme is ignored, a=testonly Automatic update from web-platform-tests[presentation-api] check if a URL with an unsupported scheme is ignored (#9966) Completes `PresentationRequest` constructor test with change [latest change made in Presentation API](https://github.com/w3c/presentation-api/pull/447). The following tests are added: - To check if an instance of `PresentationRequest` with URLs including one with an unsupported scheme is successfully constructed - To check if `NotSupportedError` is thrown when only single or multiple URLs with unsupported schemes are specified wpt-commits: 1cbb9282ad842c48fff8a86e121ce7e33f6ca4a3 wpt-pr: 9966 wpt-commits: 1cbb9282ad842c48fff8a86e121ce7e33f6ca4a3 wpt-pr: 9966
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html
testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -582847,17 +582847,17 @@
    "450dc0940b414f4150df66dcdbbd69a7f90b3ab5",
    "manual"
   ],
   "presentation-api/controlling-ua/PresentationConnection_send-manual.https.html": [
    "4f34387b135ee40a6f8fc363659096409a1eb0bd",
    "manual"
   ],
   "presentation-api/controlling-ua/PresentationRequest_error.https.html": [
-   "8d8a2a77b5735cfe4dc6d0eeb3c5bdf7f13c4148",
+   "c1156f81c778b871e741d55eed332e441c0cda1d",
    "testharness"
   ],
   "presentation-api/controlling-ua/PresentationRequest_mixedcontent.https.html": [
    "327d33780cc6954003fcb2f899611f0949117a71",
    "testharness"
   ],
   "presentation-api/controlling-ua/PresentationRequest_mixedcontent_multiple.https.html": [
    "62bdc7cf0de441659295c59b5562dc9a5795b331",
@@ -582871,17 +582871,17 @@
    "bb25b9dfe5dfefc9af937fcada964bb054f8b222",
    "testharness"
   ],
   "presentation-api/controlling-ua/PresentationRequest_sandboxing_success.https.html": [
    "140616215cb2b2dfe5ee650593ac5f7c0347dcfb",
    "testharness"
   ],
   "presentation-api/controlling-ua/PresentationRequest_success.https.html": [
-   "74cc007c2472f11bdc08410f870f270e8e4b0f4a",
+   "91cc64f165493d46bf3e9f0a303c9794bff78854",
    "testharness"
   ],
   "presentation-api/controlling-ua/common.js": [
    "c6b28c0515da47b6c82a94ed23d88dddf5a51f82",
    "support"
   ],
   "presentation-api/controlling-ua/defaultRequest.https.html": [
    "a2e430e3413075293534bf62b23ff0c8c5360282",
--- a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html
+++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html
@@ -1,33 +1,36 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
-<title>Presentation API PresentationRequest for Controlling User Agent (Error)</title>
+<title>Constructing a PresentationRequest (Error)</title>
 <link rel="author" title="Franck William Taffo" href="http://www.fokus.fraunhofer.de">
-<link rel="help" href="http://w3c.github.io/presentation-api/#dfn-controlling-user-agent">
+<link rel="author" title="Tomoyuki Shimizu" href="https://github.com/tomoyukilabs">
+<link rel="help" href="http://w3c.github.io/presentation-api/#constructing-a-presentationrequest">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script>
 
-    test(function() {
-        assert_throws(new TypeError(), function() {
-            new PresentationRequest();
-        });
+  test(() => {
+    assert_throws(new TypeError(), () => {
+      new PresentationRequest();
     }, 'Call PresentationRequest() constructor without presentation URL. TypeError Exception expected.');
 
-    test(function() {
-        assert_throws('NotSupportedError', function() {
-            new PresentationRequest([]);
-        });
+    assert_throws('NotSupportedError', () => {
+      new PresentationRequest([]);
     }, 'Call PresentationRequest constructor with an empty sequence. NotSupportedError Exception expected.');
 
-    test(function() {
-        assert_throws('SyntaxError', function() {
-            new PresentationRequest('http://@');
-        });
+    assert_throws('SyntaxError', () => {
+      new PresentationRequest('http://@');
     }, 'Call PresentationRequest constructor with an invalid URL. SyntaxError Exception expected.');
 
-    test(function() {
-        assert_throws('SyntaxError', function() {
-            new PresentationRequest(['presentation.html', 'http://@']);
-        });
+    assert_throws('NotSupportedError', () => {
+        new PresentationRequest('unsupported://example.com');
+    }, 'Call PresentationRequest constructor with an unsupported URL. NotSupportedError expected.');
+
+    assert_throws('SyntaxError', function() {
+      new PresentationRequest(['presentation.html', 'http://@']);
     }, 'Call PresentationRequest constructor with a sequence of URLs, one of them invalid. SyntaxError Exception expected.');
+
+    assert_throws('NotSupportedError', function() {
+      new PresentationRequest(['unsupported://example.com', 'invalid://example.com']);
+    }, 'Call PresentationRequest constructor only with a sequence of unsupported URLs. NotSupportedError Exception expected.');
+  });
 </script>
--- a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html
+++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html
@@ -3,22 +3,29 @@
 <title>Constructing a PresentationRequest</title>
 <link rel="author" title="Franck William Taffo" href="http://www.fokus.fraunhofer.de">
 <link rel="author" title="Tomoyuki Shimizu" href="https://github.com/tomoyukilabs/">
 <link rel="help" href="http://w3c.github.io/presentation-api/#constructing-a-presentationrequest">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 
 <script>
-    test(() => {
-        let request = new PresentationRequest('presentation.html');
-        assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with a relative presentation URL is constructed successfully.');
+  test(() => {
+    let request = new PresentationRequest('presentation.html');
+    assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with a relative presentation URL is constructed successfully.');
 
-        request = new PresentationRequest('https://example.org/');
-        assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an absolute presentation URL is constructed successfully.');
+    request = new PresentationRequest('https://example.org/');
+    assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an absolute presentation URL is constructed successfully.');
 
-        request = new PresentationRequest([
-            'presentation.html',
-            'https://example.org/presentation/'
-        ]);
-        assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an array of presentation URLs is constructed successfully.');
-    });
+    request = new PresentationRequest([
+      'presentation.html',
+      'https://example.org/presentation/'
+    ]);
+    assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an array of presentation URLs is constructed successfully.');
+
+    request = new PresentationRequest([
+      'unsupported://example.com',
+      'presentation.html',
+      'https://example.org/presentation/'
+    ]);
+    assert_true(request instanceof PresentationRequest, 'An unsupported URL in an array of presentation URLs is ignored successfully.');
+  });
 </script>
\ No newline at end of file