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

Side by Side Diff: LayoutTests/fast/speech/scripted/start-exception.html

Issue 1117383002: Changing serviceuri param to be url from string in Blink and tagging requests to speech recognizer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modifying tests to add better examples and removing the unnecessary comment Created 5 years, 7 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
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script type="text/javascript"> 7 <script type="text/javascript">
8 description('Test getting an exception when calling start() in the Speech JavaSc ript API'); 8 description('Test getting an exception when calling start() in the Speech JavaSc ript API');
9 9
10 function run() { 10 function run() {
(...skipping 13 matching lines...) Expand all
24 if (prop.match('^on')) { 24 if (prop.match('^on')) {
25 r[prop] = function() { 25 r[prop] = function() {
26 debug('on' + event.type); 26 debug('on' + event.type);
27 27
28 if (event.type === 'end') { 28 if (event.type === 'end') {
29 shouldNotThrow("r.start()"); 29 shouldNotThrow("r.start()");
30 evalAndLog("r.abort()"); 30 evalAndLog("r.abort()");
31 31
32 r.onend = function() { 32 r.onend = function() {
33 debug('onend'); 33 debug('onend');
34 finishJSTest(); 34 serviceURIInvalid();
35 } 35 }
36 } else { 36 } else {
37 shouldThrow("r.start()", '"InvalidStateError: Failed to exec ute \'start\' on \'SpeechRecognition\': recognition has already started."'); 37 shouldThrow("r.start()", '"InvalidStateError: Failed to exec ute \'start\' on \'SpeechRecognition\': recognition has already started."');
38 } 38 }
39 } 39 }
40 } 40 }
41 } 41 }
42 42
43 shouldNotThrow("r.start()"); 43 shouldNotThrow("r.start()");
44 shouldThrow("r.start()", '"InvalidStateError: Failed to execute \'start\' on \'SpeechRecognition\': recognition has already started."'); 44 shouldThrow("r.start()", '"InvalidStateError: Failed to execute \'start\' on \'SpeechRecognition\': recognition has already started."');
45 } 45 }
46 46
47 function serviceURIInvalid() {
48 debug('\nserviceURIInvalid():');
49 evalAndLog("window.r = new webkitSpeechRecognition()");
50 evalAndLog("r.serviceURI = 'http:/:/:/badurl'");
51
52 shouldThrow("r.start()", '"SyntaxError: Failed to execute \'start\' on \'Spe echRecognition\': serviceURI is neither empty nor a valid URL."');
53 evalAndLog("r.abort()");
54 finishJSTest();
55 }
56
47 window.onload = run; 57 window.onload = run;
48 window.jsTestIsAsync = true; 58 window.jsTestIsAsync = true;
49 </script> 59 </script>
50 </body> 60 </body>
51 </html> 61 </html>
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698