Diff
Modified: trunk/LayoutTests/ChangeLog (279399 => 279400)
--- trunk/LayoutTests/ChangeLog 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/ChangeLog 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,3 +1,13 @@
+2021-06-29 Chris Dumez <[email protected]>
+
+ Resync speech-api WPT tests from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=227503
+
+ Reviewed by Sam Weinig.
+
+ * platform/ios/TestExpectations:
+ * platform/mac/TestExpectations:
+
2021-06-29 Arcady Goldmints-Orlov <[email protected]>
[GLIB] Unreviewed test gardening, update baselines after r279169
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,5 +1,16 @@
2021-06-29 Chris Dumez <[email protected]>
+ Resync speech-api WPT tests from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=227503
+
+ Reviewed by Sam Weinig.
+
+ Resync speech-api WPT tests from upstream a38612f39e7752c353208.
+
+ * web-platform-tests/speech-api/*: Updated.
+
+2021-06-29 Chris Dumez <[email protected]>
+
Resync css/cssom WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227506
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/META.yml (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/META.yml 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/META.yml 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,4 +1,5 @@
-spec: https://w3c.github.io/speech-api/
+spec: https://wicg.github.io/speech-api/
suggested_reviewers:
- andrenatal
- - gshires
+ - foolip
+ - marcoscaceres
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative-expected.txt (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,3 @@
+
+PASS speechSynthesis.pause() and resume() state and events
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,50 @@
+<!doctype html>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<body>
+<script>
+// This test is tentative because timing isn't defined:
+// https://github.com/w3c/speech-api/issues/39
+// https://github.com/w3c/speech-api/issues/40
+async_test(t => {
+ assert_false(speechSynthesis.paused, 'initial paused state');
+
+ test_driver.bless('speechSynthesis.speak', t.step_func(() => {
+ const sentence = `long sentence which will take at least a few seconds to
+ utter so that it's possible to pause and resume before the end`;
+ const utter = new SpeechSynthesisUtterance(sentence);
+ t.add_cleanup(() => speechSynthesis.pause());
+ utter._onerror_ = t.unreached_func('error event');
+
+ speechSynthesis.speak(utter);
+
+ assert_false(speechSynthesis.paused, 'paused state after speak()');
+
+ utter._onstart_ = t.step_func(() => {
+ utter._onstart_ = null;
+ assert_false(speechSynthesis.paused, 'paused state at start event');
+
+ speechSynthesis.pause();
+
+ // paused state changes async, right before the pause event
+ assert_false(speechSynthesis.paused, 'paused state after pause()');
+
+ utter._onpause_ = t.step_func(() => {
+ utter._onpause_ = null;
+ assert_true(speechSynthesis.paused, 'paused state at pause event');
+
+ speechSynthesis.resume();
+
+ // paused state changes async, right before the resume event
+ assert_true(speechSynthesis.paused, 'paused state after resume()');
+
+ utter._onresume_ = t.step_func_done(() => {
+ assert_false(speechSynthesis.paused, 'paused state at resume event');
+ });
+ });
+ });
+ }));
+}, 'speechSynthesis.pause() and resume() state and events');
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,4 @@
+
+FAIL speechSynthesis.speak() fires start and end events with empty utterance assert_true: Not expecting event, but got end event expected true got false
+PASS speechSynthesis.speak() fires start and end events
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,22 @@
+<!doctype html>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<body>
+<script>
+async function runStartEndTest(t, utterance) {
+ const eventWatcher = new EventWatcher(t, utterance, ['start', 'end', 'error']);
+ await test_driver.bless('speechSynthesis.speak',
+ () => speechSynthesis.speak(utterance));
+ await eventWatcher.wait_for(['start', 'end']);
+}
+promise_test(async (t) => {
+ const utterance = new SpeechSynthesisUtterance();
+ await runStartEndTest(t, utterance);
+}, 'speechSynthesis.speak() fires start and end events with empty utterance');
+promise_test(async (t) => {
+ const utterance = new SpeechSynthesisUtterance('test');
+ await runStartEndTest(t, utterance);
+}, 'speechSynthesis.speak() fires start and end events');
+</script>
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership-expected.txt (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership-expected.txt 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,4 +0,0 @@
-
-
-FAIL Using the same SpeechSynthesisUtterance with two SpeechSynthesis instances Can't find variable: assert_throws
-
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership.html (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership.html 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,23 +0,0 @@
-<!doctype html>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<iframe></iframe>
-<script>
-// using an utterance for different SpeechSynthesis instances should throw
-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>
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds-expected.txt (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds-expected.txt 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,3 +0,0 @@
-
-PASS speechSynthesis.speak requires user activation
-
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,15 +0,0 @@
-<!doctype html>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<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>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -8,7 +8,7 @@
async_test(t => {
const utter = new SpeechSynthesisUtterance('1');
utter._onerror_ = t.step_func_done((e) => {
- assert_equals(e.name, "not-allowed");
+ assert_equals(e.error, "not-allowed");
});
utter._onend_ = t.step_func_done(() => assert_unreached());
speechSynthesis.speak(utter);
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,40 @@
+
+FAIL SpeechSynthesisErrorEvent with no arguments throws TypeError assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent();
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+FAIL SpeechSynthesisErrorEvent with no eventInitDict throws TypeError assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent("type");
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+FAIL SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires
+ utterance and error) assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent("type", {});
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+FAIL SpeechSynthesisErrorEvent with eventInitDict without utterance throws
+ TypeError assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent("type", {error:"not-allowed"});
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+FAIL SpeechSynthesisErrorEvent with eventInitDict without error throws
+ TypeError assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent("type", {utterance: new SpeechSynthesisUtterance()});
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+FAIL SpeechSynthesisErrorEvent with eventInitDict having utterance and error Can't find variable: SpeechSynthesisErrorEvent
+FAIL SpeechSynthesisErrorEvent with custom eventInitDict Can't find variable: SpeechSynthesisErrorEvent
+FAIL SpeechSynthesisErrorEvent with wrong error enum assert_throws_js: function "() => {
+ new SpeechSynthesisErrorEvent("type", {
+ utterance: new SpeechSynthesisUtterance(),
+ error: error
+ });
+ }" threw object "ReferenceError: Can't find variable: SpeechSynthesisErrorEvent" ("ReferenceError") expected instance of function "function TypeError() {
+ [native code]
+}" ("TypeError")
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor.html (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+<script>
+/*
+[Exposed=Window,
+ Constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict)]
+interface SpeechSynthesisErrorEvent : SpeechSynthesisErrorEvent {
+ readonly attribute SpeechSynthesisErrorCode error;
+};
+*/
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisErrorEvent();
+ });
+}, "SpeechSynthesisErrorEvent with no arguments throws TypeError");
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisErrorEvent("type");
+ });
+}, "SpeechSynthesisErrorEvent with no eventInitDict throws TypeError");
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisErrorEvent("type", {});
+ });
+}, `SpeechSynthesisErrorEvent with empty eventInitDict throws TypeError (requires
+ utterance and error)`);
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisErrorEvent("type", {error:"not-allowed"});
+ });
+}, `SpeechSynthesisErrorEvent with eventInitDict without utterance throws
+ TypeError`);
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisErrorEvent("type", {utterance: new SpeechSynthesisUtterance()});
+ });
+}, `SpeechSynthesisErrorEvent with eventInitDict without error throws
+ TypeError`);
+
+test(() => {
+ const utterance = new SpeechSynthesisUtterance("foo");
+ const event = new SpeechSynthesisErrorEvent("type", {utterance: utterance, error:"not-allowed"});
+ assert_equals(event.utterance, utterance);
+ assert_equals(event.error, "not-allowed");
+ assert_equals(event.charIndex, 0);
+ assert_equals(event.elapsedTime, 0);
+ assert_equals(event.name, "");
+}, "SpeechSynthesisErrorEvent with eventInitDict having utterance and error");
+
+test(() => {
+ const utterance = new SpeechSynthesisUtterance("foo");
+ const event = new SpeechSynthesisErrorEvent("type", {
+ utterance: utterance,
+ charIndex: 5,
+ elapsedTime: 100,
+ name: "foo",
+ error: "synthesis-failed"
+ });
+ assert_equals(event.bubbles, false);
+ assert_equals(event.cancelable, false);
+ assert_equals(event.type, "type");
+ assert_equals(event.utterance, utterance);
+ assert_equals(event.charIndex, 5);
+ assert_equals(event.elapsedTime, 100);
+ assert_equals(event.name, "foo");
+ assert_equals(event.error, "synthesis-failed");
+}, "SpeechSynthesisErrorEvent with custom eventInitDict");
+
+test(() => {
+ function createEventFunc(error) {
+ return () => {
+ new SpeechSynthesisErrorEvent("type", {
+ utterance: new SpeechSynthesisUtterance(),
+ error: error
+ });
+ };
+ };
+ assert_throws_js(TypeError, createEventFunc(""));
+ assert_throws_js(TypeError, createEventFunc("foo"));
+ assert_throws_js(TypeError, createEventFunc("bar"));
+}, "SpeechSynthesisErrorEvent with wrong error enum");
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,10 @@
+
+PASS SpeechSynthesisEvent with no arguments throws TypeError
+PASS SpeechSynthesisEvent with no eventInitDict throws TypeError
+PASS SpeechSynthesisEvent with empty eventInitDict throws TypeError (requires
+ utterance)
+PASS SpeechSynthesisEvent with eventInitDict not having utterance throws
+ TypeError
+FAIL SpeechSynthesisEvent with eventInitDict having an utterance Illegal constructor
+FAIL SpeechSynthesisEvent with custom eventInitDict Illegal constructor
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor.html (0 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+<script>
+/*
+[Exposed=Window,
+ Constructor(DOMString type, SpeechSynthesisEventInit eventInitDict)]
+interface SpeechSynthesisEvent : Event {
+ readonly attribute SpeechSynthesisUtterance utterance;
+ readonly attribute unsigned long charIndex;
+ readonly attribute float elapsedTime;
+ readonly attribute DOMString name;
+};
+*/
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisEvent();
+ });
+}, "SpeechSynthesisEvent with no arguments throws TypeError");
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisEvent("type");
+ });
+}, "SpeechSynthesisEvent with no eventInitDict throws TypeError");
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisEvent("type", {});
+ });
+}, `SpeechSynthesisEvent with empty eventInitDict throws TypeError (requires
+ utterance)`);
+
+test(() => {
+ assert_throws_js(TypeError, () => {
+ new SpeechSynthesisEvent("type", {charIndex: 10, elapsedTime: 50, name:"foo"});
+ });
+}, `SpeechSynthesisEvent with eventInitDict not having utterance throws
+ TypeError`);
+
+test(() => {
+ const utterance = new SpeechSynthesisUtterance("foo");
+ const event = new SpeechSynthesisEvent("type", {utterance: utterance});
+ assert_equals(event.utterance, utterance);
+ assert_equals(event.charIndex, 0);
+ assert_equals(event.charLength, 0);
+ assert_equals(event.elapsedTime, 0);
+ assert_equals(event.name, "");
+}, "SpeechSynthesisEvent with eventInitDict having an utterance");
+
+test(() => {
+ const utterance = new SpeechSynthesisUtterance("foo");
+ const event = new SpeechSynthesisEvent("type", {
+ utterance: utterance,
+ charIndex: 5,
+ charLength: 3,
+ elapsedTime: 100,
+ name: "foo"
+ });
+ assert_equals(event.bubbles, false);
+ assert_equals(event.cancelable, false);
+ assert_equals(event.type, "type");
+ assert_equals(event.utterance, utterance);
+ assert_equals(event.charIndex, 5);
+ assert_equals(event.charLength, 3);
+ assert_equals(event.elapsedTime, 100);
+ assert_equals(event.name, "foo");
+}, "SpeechSynthesisEvent with custom eventInitDict");
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https-expected.txt (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https-expected.txt 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -6,5 +6,7 @@
PASS new SpeechSynthesisUtterance() default rate
PASS new SpeechSynthesisUtterance() default pitch
PASS new SpeechSynthesisUtterance("hello") text and defaults
+PASS new SpeechSynthesisUtterance(null)
+PASS new SpeechSynthesisUtterance(undefined)
PASS SpeechSynthesisUtterance text setter
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https.html (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https.html 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -31,6 +31,17 @@
}, 'new SpeechSynthesisUtterance("hello") text and defaults');
test(function() {
+ const utt = new SpeechSynthesisUtterance(null);
+ assert_equals(utt.text, 'null');
+}, 'new SpeechSynthesisUtterance(null)');
+
+test(function() {
+ const utt = new SpeechSynthesisUtterance(undefined);
+ // See https://github.com/w3c/speech-api/pull/48.
+ assert_equals(utt.text, '');
+}, 'new SpeechSynthesisUtterance(undefined)');
+
+test(function() {
const utt = new SpeechSynthesisUtterance();
utt.text = 'word';
assert_equals(utt.text, 'word');
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical-expected.txt (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical-expected.txt 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -5,4 +5,7 @@
FAIL webkitSpeechRecognition interface should not exist assert_false: expected false got true
PASS webkitSpeechRecognitionError interface should not exist
PASS webkitSpeechRecognitionEvent interface should not exist
+FAIL SpeechRecognition's serviceURI attribute should not exist assert_implements: SpeechRecognition exposed undefined
+PASS SpeechRecognitionEvent's interpretation attribute should not exist
+PASS SpeechRecognitionEvent's emma attribute should not exist
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical.html (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical.html 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical.html 2021-06-30 02:13:41 UTC (rev 279400)
@@ -12,8 +12,23 @@
"webkitSpeechRecognitionError",
"webkitSpeechRecognitionEvent",
].forEach(name => {
- test(function() {
+ test(() => {
assert_false(name in window);
- }, name + " interface should not exist");
+ }, `${name} interface should not exist`);
});
+
+test(() => {
+ assert_implements('SpeechRecognition' in window, 'SpeechRecognition exposed');
+ assert_false("serviceURI" in SpeechRecognition.prototype);
+}, "SpeechRecognition's serviceURI attribute should not exist");
+
+[
+ "interpretation",
+ "emma",
+].forEach(name => {
+ test(() => {
+ assert_implements('SpeechRecognitionEvent' in window, 'SpeechRecognitionEvent exposed');
+ assert_false(name in SpeechRecognitionEvent.prototype);
+ }, `SpeechRecognitionEvent's ${name} attribute should not exist`);
+});
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window.js (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window.js 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window.js 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1,12 +1,30 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
+// META: timeout=long
'use strict';
+// https://w3c.github.io/speech-api/#dom-speechsynthesis-getvoices can
+// return an empty list and a voiceschanged event is fired if the list of
+// voices is determined asynchronously.
+function getVoices() {
+ return new Promise(resolve => {
+ const voices = speechSynthesis.getVoices();
+ if (voices.length) {
+ resolve(voices);
+ } else {
+ // wait for voiceschanged event
+ speechSynthesis.addEventListener('voiceschanged', () => {
+ resolve(speechSynthesis.getVoices());
+ }, { once: true });
+ }
+ });
+}
+
idl_test(
['speech-api'],
['dom', 'html'],
- idl_array => {
+ (idl_array, t) => {
idl_array.add_objects({
SpeechGrammar: ['new SpeechGrammar()'],
SpeechGrammarList: ['new SpeechGrammarList()'],
@@ -20,15 +38,14 @@
// TODO: SpeechSynthesisErrorEvent
// TODO: SpeechSynthesisEvent
SpeechSynthesisUtterance: ['new SpeechSynthesisUtterance()'],
+ SpeechSynthesisVoice: ['voice'],
Window: ['self'],
});
- // https://w3c.github.io/speech-api/#dom-speechsynthesis-getvoices can
- // return an empty list, so add SpeechSynthesisVoice conditionally.
- const voices = speechSynthesis.getVoices();
- if (voices.length) {
- self.voice = voices[0];
- idl_array.add_objects({ SpeechSynthesisVoice: ['voice'] });
- }
+ const awaitVoice = getVoices().then(voices => self.voice = voices[0]);
+ const timeout = new Promise((_, reject) => {
+ t.step_timeout(() => reject('Timed out waiting for voice'), 3000);
+ });
+ return Promise.race([awaitVoice, timeout]);
}
);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/w3c-import.log (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/w3c-import.log 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/w3c-import.log 2021-06-30 02:13:41 UTC (rev 279400)
@@ -16,10 +16,12 @@
List of files:
/LayoutTests/imported/w3c/web-platform-tests/speech-api/META.yml
/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechRecognition-basics.https.html
-/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-ownership.html
+/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html
/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-twice.html
-/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html
/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisErrorEvent-constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisEvent-constructor.html
/LayoutTests/imported/w3c/web-platform-tests/speech-api/SpeechSynthesisUtterance-basics.https.html
/LayoutTests/imported/w3c/web-platform-tests/speech-api/historical.html
/LayoutTests/imported/w3c/web-platform-tests/speech-api/idlharness.window.js
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/webspeech.js (279399 => 279400)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/webspeech.js 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/speech-api/webspeech.js 2021-06-30 02:13:41 UTC (rev 279400)
@@ -6,9 +6,8 @@
GLOBAL_TIMEOUT = TIMEOUT + 2000; // In milliseconds.
setup({timeout: GLOBAL_TIMEOUT});
var _onstarted_ = false;
-var neverFireTest = async_test('Events that should not fire',
- {timeout: TIMEOUT});
-var _onstartTest_ = async_test('onstart', {timeout: TIMEOUT});
+var neverFireTest = async_test('Events that should not fire');
+var _onstartTest_ = async_test('onstart');
var reco = new SpeechRecognition();
reco._onstart_ = onstartTest.step_func(function(event) {
@@ -41,7 +40,7 @@
this.min = min;
this.max = max;
this.sum = 0;
- this.asyncTest = async_test(name, {timeout: TIMEOUT});
+ this.asyncTest = async_test(name);
this.count = function(increment) { this.sum += increment; };
@@ -52,7 +51,7 @@
this.asyncTest.step(function() {
notes.innerHTML += cTest.name + ' occurred ' + cTest.sum + ' times.<br>';
if (cTest.min == cTest.max) {
- assert_true(cTest.sum == cTest.min, cTest.name + ' occurred ' +
+ assert_equals(cTest.sum, cTest.min, cTest.name + ' occurred ' +
cTest.sum + ' times and should have occurred ' +
cTest.min + ' times.');
} else {
@@ -77,7 +76,7 @@
this.name = name;
this.count = 0; // Counts number of start / end cycles.
this.started = false; // Tracks whether last event was a start or end event.
- this.test = async_test(name + ' start/stop', {timeout: TIMEOUT});
+ this.test = async_test(name + ' start/stop');
this.startEvent = function() {
var cycle = this;
Modified: trunk/LayoutTests/platform/ios/TestExpectations (279399 => 279400)
--- trunk/LayoutTests/platform/ios/TestExpectations 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2021-06-30 02:13:41 UTC (rev 279400)
@@ -3333,8 +3333,8 @@
media/media-continues-playing-after-replace-source.html [ Pass Failure ]
imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-twice.html [ Skip ]
-imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html [ Skip ]
imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html [ Skip ]
+webkit.org/b/227501 [ Debug ] imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html [ Skip ]
# This test fails in iOS due to subpixel differences for the marker position
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (279399 => 279400)
--- trunk/LayoutTests/platform/ios-wk2/TestExpectations 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations 2021-06-30 02:13:41 UTC (rev 279400)
@@ -1928,6 +1928,9 @@
webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer.html [ Pass ]
webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html [ Pass ]
+imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html [ Pass Failure ]
+imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html [ Pass Failure ]
+
# @counter-style WPT failures specific to ios-wk2
imported/w3c/web-platform-tests/css/css-counter-styles/bengali/css3-counter-styles-117.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-counter-styles/gujarati/css3-counter-styles-123.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/platform/mac/TestExpectations (279399 => 279400)
--- trunk/LayoutTests/platform/mac/TestExpectations 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2021-06-30 02:13:41 UTC (rev 279400)
@@ -2089,8 +2089,8 @@
webkit.org/b/217620 inspector/audit/basic-async.html [ Pass Timeout ]
imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-twice.html [ Skip ]
-imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-with-activation-succeeds.html [ Skip ]
imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html [ Skip ]
+webkit.org/b/227501 [ Debug ] imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html [ Skip ]
webkit.org/b/217669 http/wpt/service-workers/service-worker-spinning-message.https.html [ Pass Failure ]
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (279399 => 279400)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2021-06-30 02:12:15 UTC (rev 279399)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2021-06-30 02:13:41 UTC (rev 279400)
@@ -74,6 +74,7 @@
fast/speechrecognition/start-recognition-after-gum.html [ Skip ]
fast/speechrecognition/start-recognition-after-denied-gum.html [ Skip ]
+imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-pause-resume.tentative.html [ Skip ]
# Datalist is unsupported in WK1
accessibility/datalist.html [ WontFix ]
Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt (0 => 279400)
--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
@@ -0,0 +1,4 @@
+
+FAIL speechSynthesis.speak() fires start and end events with empty utterance assert_true: Not expecting event, but got end event expected true got false
+FAIL speechSynthesis.speak() fires start and end events assert_true: Not expecting event, but got start event expected true got false
+