Bug 1491602 [wpt PR 13018] - Test new SpeechSynthesisUtterance(null/undefined), a=testonly
authorPhilip Jägenstedt <philip@foolip.org>
Fri, 05 Oct 2018 14:28:56 +0000
changeset 495828 89a485a70c00e524e96a52b0ce502077ca7e662b
parent 495827 068d25bb9c769565debec25e8d8fd6673f88ea26
child 495829 1a703d10ac50c5c198771b9dda8000f6376a0b2e
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1491602, 13018
milestone64.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 1491602 [wpt PR 13018] - Test new SpeechSynthesisUtterance(null/undefined), a=testonly Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018) This is targeting a mundane difference in `new SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of the construtor uses a single constructor with an optional argument, or two constructor overloads with zero and one argument respectively. Follows https://github.com/w3c/speech-api/pull/48. -- wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34 wpt-pr: 13018
testing/web-platform/tests/speech-api/SpeechSynthesisUtterance-basics.https.html
--- a/testing/web-platform/tests/speech-api/SpeechSynthesisUtterance-basics.https.html
+++ b/testing/web-platform/tests/speech-api/SpeechSynthesisUtterance-basics.https.html
@@ -26,15 +26,26 @@ test(function() {
   for (const prop in DEFAULTS) {
     if (prop != 'text') {
       assert_equals(utt[prop], DEFAULTS[prop], prop);
     }
   }
 }, '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');
 }, 'SpeechSynthesisUtterance text setter');
 
 // TODO: setters https://github.com/w3c/speech-api/issues/29
 </script>