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

Side by Side Diff: LayoutTests/fast/speech/scripted/speechrecognition-detached-no-crash.html

Issue 960223002: Detach SpeechRecognitionController upon page detach. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: have SpeechRecognition observe the page instead Created 5 years, 9 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("Accessing SpeechRecognition on a detached window should not crash." );
9
10 window.jsTestIsAsync = true;
11
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
15 testRunner.setCanOpenWindows();
16 }
17
18 var w;
19 var recognition;
20 var constructor;
21
22 function processMessage(event) {
23 if (event.data == "opened") {
24 constructor = w.webkitSpeechRecognition;
25 recognition = new constructor();
26 w.close();
27 } else if (event.data == "closed") {
28 shouldBeUndefined("recognition.start()");
29 shouldBeUndefined("recognition.stop()");
30 shouldBeUndefined("recognition.abort()");
31 shouldThrow("new constructor()");
32 finishJSTest();
33 }
34 }
35
36 w = window.open('../../../resources/window-postmessage-open-close.html');
37 window.addEventListener("message", processMessage, false);
38 </script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698