Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: LayoutTests/fast/speechsynthesis/speech-synthesis-speak-multiple.html

Issue 884973003: Extend PlatformSpeechSynthesizerMock with an utterance queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This tests that multiple speak utterances are handled in sequen ce.");
9
10 if (window.internals)
11 window.internals.enableMockSpeechSynthesizer(document);
12
13 if (window.testRunner)
14 testRunner.waitUntilDone();
15
16 window.jsTestIsAsync = true;
17
18 var count = 3;
19 var i = 0;
20
21 // Start a very short speaking job that will finish quickly.
22 var u = new SpeechSynthesisUtterance(" ");
23 u.onstart = function(event) {
24 shouldBeTrue("event.elapsedTime > 0");
25 shouldBeTrue("speechSynthesis.speaking");
26 };
27 u.onend = function(event) {
28 shouldBeGreaterThanOrEqual("count", "i");
29 shouldBeTrue("event.elapsedTime > 0");
30 shouldBeTrue("speechSynthesis.speaking");
31 if (++i == count) {
32 speechSynthesis.cancel();
33 finishJSTest();
34 }
35 };
36
37 shouldBeFalse("speechSynthesis.speaking");
38 // Issue more utterances than where we break off.
39 for (var j = 0; j < count + 2; ++j)
40 speechSynthesis.speak(u);
41 </script>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698