OLD | NEW |
| (Empty) |
1 <!-- | |
2 var port; | |
3 var timeout; | |
4 onerror = function(a,b,c,d,e) { | |
5 // will return undefined, thus the error is "not handled" | |
6 // so error should be reported to the user, but this test doesn't check | |
7 // that. | |
8 // just make sure that this method is invoked with five arguments | |
9 clearTimeout(timeout); | |
10 var log = ''; | |
11 if (arguments.length != 5) | |
12 log += 'got ' + arguments.length + ' arguments, expected 5. '; | |
13 if (typeof a != 'string') | |
14 log += 'first argument wasn\'t a string. '; | |
15 if (b != location.href) | |
16 log += 'second argument was ' + b + ', expected ' + location.href + '. '; | |
17 if (typeof c != 'number') | |
18 log += 'third argument wasn\'t a number. '; | |
19 if (typeof d != 'number') | |
20 log += 'fourth argument wasn\'t a number. '; | |
21 if (e != 42) | |
22 log += 'fifth argument wasn\'t the thrown exception. '; | |
23 port.postMessage(log); | |
24 } | |
25 onconnect = function (e) { | |
26 port = e.ports[0]; | |
27 timeout = setTimeout(function() { port.postMessage('self.onerror was not invok
ed'); }, 250); | |
28 throw 42; // will "report the error" | |
29 } | |
30 | |
31 | |
32 /* | |
33 --> | |
34 <!doctype html> | |
35 <title>shared worker, not handled</title> | |
36 <script src="/resources/testharness.js"></script> | |
37 <script src="/resources/testharnessreport.js"></script> | |
38 <div id=log></div> | |
39 <script> | |
40 setup({allow_uncaught_exception:true}); | |
41 async_test(function() { | |
42 window.onerror = this.step_func(function(a) { | |
43 assert_unreached('window.onerror invoked: ' + a); | |
44 }); | |
45 var worker = new SharedWorker('#', ''); | |
46 worker.port.onmessage = this.step_func_done(function(e) { | |
47 assert_equals(e.data, ''); | |
48 }); | |
49 }); | |
50 </script> | |
51 <!-- | |
52 */ | |
53 //--> | |
OLD | NEW |