Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / workers / worker-invalid-context.html
blob790f44980359ec6a3c26fe89ed6b259ad63e8acf
1 <html>
2 <body>
3 <p>This test checks that the invalid context doesn't cause crashes.</p>
4 <script src="resources/worker-util.js"></script>
5 <div id=result></div>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.setCanOpenWindows();
10 testRunner.waitUntilDone();
13 var callbackCount = 0;
15 function callback() {
16 ++callbackCount;
17 if (callbackCount == 10) {
18 done();
19 return;
21 try {
22 // After "p.Worker = w.Worker;" is called, Worker::create() may be called with an invalid context.
23 var a = new Worker('a');
24 } catch (error) { }
25 var p = window.parent;
26 var w = window.open("x", "y");
27 p.Worker = w.Worker;
28 setTimeout(callback, 1);
31 setTimeout(callback, 1);
32 </script>
33 </body>
34 </html>