Bug 1481246 [wpt PR 12327] - SpeechSynthesis.speak requires activation, a=testonly
authorCharlie Harrison <csharrison@chromium.org>
Wed, 15 Aug 2018 01:00:53 +0000
changeset 486809 0af3cd1d119b4aca7292fe54ed0985fa9494bb58
parent 486808 d27af016f4fc054d00c7cd424d7f6392362b62e8
child 486810 4e0dfd2db07ecaa226ddb4df3cc845b3490feb51
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1481246, 12327
milestone63.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 1481246 [wpt PR 12327] - SpeechSynthesis.speak requires activation, a=testonly Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327) Follows https://github.com/w3c/speech-api/pull/28. -- wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd wpt-pr: 12327
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/speech-api/SpeechSynthesis-speak-ownership.html
testing/web-platform/tests/speech-api/SpeechSynthesis-speak-twice.html
testing/web-platform/tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html
testing/web-platform/tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -389800,22 +389800,40 @@
     [
      "/speech-api/SpeechRecognition-basics.https.html",
      {}
     ]
    ],
    "speech-api/SpeechSynthesis-speak-ownership.html": [
     [
      "/speech-api/SpeechSynthesis-speak-ownership.html",
-     {}
+     {
+      "testdriver": true
+     }
     ]
    ],
    "speech-api/SpeechSynthesis-speak-twice.html": [
     [
      "/speech-api/SpeechSynthesis-speak-twice.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "speech-api/SpeechSynthesis-speak-with-activation-succeeds.html": [
+    [
+     "/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html": [
+    [
+     "/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html",
      {}
     ]
    ],
    "speech-api/SpeechSynthesisUtterance-basics.https.html": [
     [
      "/speech-api/SpeechSynthesisUtterance-basics.https.html",
      {}
     ]
@@ -631451,21 +631469,29 @@
    "6a0877bbe1e3354b006e1e882620180e3e8bd2fe",
    "manual"
   ],
   "speech-api/SpeechRecognition-stop-manual.https.html": [
    "e4741b7fc6f450a5038f99c1b3de15ae4f5b0db0",
    "manual"
   ],
   "speech-api/SpeechSynthesis-speak-ownership.html": [
-   "64bed13bd53a2a3b5ca6ccc8b2e17b686beaaf81",
+   "f2121fc561de1f25a4de27372ca42a2b1e97a10a",
    "testharness"
   ],
   "speech-api/SpeechSynthesis-speak-twice.html": [
-   "4e4ee34565c1228532d4a892dfa7782334939156",
+   "3e0388b9cf37cae2075380faf48414a48b4092e9",
+   "testharness"
+  ],
+  "speech-api/SpeechSynthesis-speak-with-activation-succeeds.html": [
+   "55dec5c123ff6384e6a30694c6a9fb6b27bc5b51",
+   "testharness"
+  ],
+  "speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html": [
+   "acf0d7d575b5dc7f9b348d82b056aa90089b6639",
    "testharness"
   ],
   "speech-api/SpeechSynthesisUtterance-basics.https.html": [
    "9a90f086ac451d09922f05b55144818e787a5ded",
    "testharness"
   ],
   "speech-api/historical.html": [
    "2fb0ccd4b905b4503f0affa4c8c7be3141871fe3",
--- a/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-ownership.html
+++ b/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-ownership.html
@@ -1,19 +1,23 @@
 <!doctype html>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
 <iframe></iframe>
 <script>
 // using an utterance for different SpeechSynthesis instances should throw
-test(t => {
-  // the utterance is short to make the test faster
-  const utter = new SpeechSynthesisUtterance('1');
-  const iframe = document.querySelector('iframe');
-  assert_not_equals(speechSynthesis, iframe.contentWindow.speechSynthesis);
-  speechSynthesis.speak(utter);
-  // the spec doesn't say what exception to throw:
-  // https://github.com/w3c/speech-api/issues/8
-  assert_throws(null, () => {
-    iframe.contentWindow.speechSynthesis.speak(utter);
-  });
+async_test(t => {
+  test_driver.bless('speechSynthesis.speak', t.step_func_done(() => {
+    // the utterance is short to make the test faster
+    const utter = new SpeechSynthesisUtterance('1');
+    const iframe = document.querySelector('iframe');
+    assert_not_equals(speechSynthesis, iframe.contentWindow.speechSynthesis);
+    speechSynthesis.speak(utter);
+    // the spec doesn't say what exception to throw:
+    // https://github.com/w3c/speech-api/issues/8
+    assert_throws(null, () => {
+      iframe.contentWindow.speechSynthesis.speak(utter);
+    });
+  }));
 }, 'Using the same SpeechSynthesisUtterance with two SpeechSynthesis instances');
 </script>
--- a/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-twice.html
+++ b/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-twice.html
@@ -1,17 +1,22 @@
 <!doctype html>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<body>
 <script>
 // using an utterance twice on the same SpeechSynthesis instance should work
 // https://github.com/w3c/speech-api/issues/7
 async_test(t => {
-  // the utterance is short to make the test faster
-  const utter = new SpeechSynthesisUtterance('1');
-  speechSynthesis.speak(utter);
-  utter.onend = t.step_func(() => {
+  test_driver.bless('speechSynthesis.speak', t.step_func(() => {
+    // the utterance is short to make the test faster
+    const utter = new SpeechSynthesisUtterance('1');
     speechSynthesis.speak(utter);
-    // pass if the utterance finishes a second time
-    utter.onend = t.step_func_done();
-  });
+    utter.onend = t.step_func(() => {
+      speechSynthesis.speak(utter);
+      // pass if the utterance finishes a second time
+      utter.onend = t.step_func_done();
+    });
+  }));
 }, 'Using the same SpeechSynthesisUtterance twice for speechSynthesis.speak()');
 </script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<body>
+<script>
+async_test(t => {
+  test_driver.bless('speechSynthesis.speak', t.step_func(() => {
+    const utter = new SpeechSynthesisUtterance('1');
+    utter.onend = t.step_func_done();
+    speechSynthesis.speak(utter);
+  }));
+}, 'speechSynthesis.speak requires user activation');
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+// TODO(csharrison): Make this test not tentative once
+// https://github.com/w3c/speech-api/issues/35 is resolved.
+async_test(t => {
+  const utter = new SpeechSynthesisUtterance('1');
+  utter.onerror = t.step_func_done((e) => {
+    assert_equals(e.name, "not-allowed");
+  });
+  utter.onend = t.step_func_done(() => assert_unreached());
+  speechSynthesis.speak(utter);
+}, 'speechSynthesis.speak requires user activation');
+</script>