Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / speech / scripted / speechrecognition-errors.html
blob95d731fa3976ac9ce7d96cf502d8ffb0ad849427
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script type="text/javascript">
8 description('Test Speech JavaScript API errors');
10 function run() {
11 // Check availability of constructors.
12 shouldBeTrue("'webkitSpeechRecognition' in self");
13 shouldBeFalse("webkitSpeechRecognition == null");
15 notAllowedTest();
18 function setDefaultHandlers(r) {
19 for (var prop in r) {
20 if (prop.match('^on')) {
21 r[prop] = function() {
22 testFailed('unexpected ' + event.type + ' event!');
23 finishJSTest();
29 function notAllowedTest() {
30 debug('\nnotAllowedTest():');
31 var r = new webkitSpeechRecognition();
32 setDefaultHandlers(r);
33 window.count = 0;
35 r.start();
36 testRunner.setMockSpeechRecognitionError("NotAllowedError", "not allowed");
38 // Check that we get an error event.
39 r.onerror = function() {
40 debug('onerror');
41 shouldBe('count', '0');
42 count++;
43 shouldBeEqualToString('event.error', 'not-allowed');
44 shouldBeEqualToString('event.message', 'not allowed');
45 shouldBeEqualToString('event.type', 'error');
48 // Check that we get an end event after the error event.
49 r.onend = function() {
50 debug('onend');
51 shouldBe('count', '1');
52 finishJSTest();
56 window.onload = run;
57 window.jsTestIsAsync = true;
58 </script>
59 </body>
60 </html>