Fetching a Worker with url that isn't allowed from a file based test causes DRT to...
[WebKit-https.git] / LayoutTests / fast / workers / worker-crash-with-invalid-location.html
1 <html>
2 <body>
3 <p>Test worker fetch of blocked url. Should print a "PASS" statement.</p>
4 <div id=result></div>
5 <script>
6 if (window.layoutTestController)
7     layoutTestController.dumpAsText();
8
9 function log(message)
10 {
11     document.getElementById("result").innerHTML += message + "<br>";
12 }
13
14 try {
15     // DumpRenderTree allows a request to this url, but then blocks it
16     // during the "willSendRequest" callback (which caused a crash).
17     // In a browser, this will throw a security exception.
18     new Worker("http://example.com/worker.js");
19 } catch (error) {
20 }
21
22 try {
23     // Ditto.
24     new SharedWorker("http://example.com/worker.js");
25 } catch (error) {
26 }
27
28 log("PASS");
29
30 </script>
31 </body>
32 </html>