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

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: minor test tidying 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
« no previous file with comments | « no previous file | LayoutTests/fast/speechsynthesis/speech-synthesis-speak-multiple-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Add a new utterance just after the cancel() to signal test comple tion.
34 speechSynthesis.speak(finishingUtterance);
35 }
36 };
37
38 var finishingUtterance = new SpeechSynthesisUtterance(" ");
39 finishingUtterance.onend = finishJSTest;
40
41 shouldBeFalse("speechSynthesis.speaking");
42 // Issue more utterances than where we break off.
43 for (var j = 0; j < count + 2; ++j)
44 speechSynthesis.speak(u);
45 </script>
46 </body>
47 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/speechsynthesis/speech-synthesis-speak-multiple-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698