runtime-error-cross-origin.html (1167B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>window.onerror - runtime error in <script src=//www1...></title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 </head> 8 <body> 9 <div id=log></div> 10 <script> 11 setup({allow_uncaught_exception:true}); 12 var t = async_test(); 13 var t_col = async_test(document.title+' (column)'); 14 var ran = false; 15 var col_value; 16 window.onerror = t.step_func(function(a, b, c, d){ 17 ran = true; 18 col_value = d; 19 assert_equals(a, 'Script error.', 'first arg'); 20 assert_equals(b, '', 'second arg'); 21 assert_equals(c, 0, 'third arg'); 22 }); 23 var script = document.createElement('script'); 24 script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable.js'); 25 document.body.appendChild(script); 26 onload = function(){ 27 t.step(function(){ 28 assert_true(ran, 'ran'); 29 t.done(); 30 }); 31 t_col.step(function(){ 32 assert_equals(col_value, 0, 'fourth arg'); 33 t_col.done(); 34 }); 35 }; 36 </script> 37 </body> 38 </html>