diff options
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/scripting/processing-model-2')
40 files changed, 1203 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html new file mode 100644 index 000000000..dbb1cdd5a --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html @@ -0,0 +1,32 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - addEventListener</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var ran = false; + window.addEventListener('error', t.step_func(function(e){ + ran = true; + assert_true(e.isTrusted, 'isTrusted'); + }), false); + </script> + <script> + undefined_variable; + </script> + <script> + for (;) {} + </script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html new file mode 100644 index 000000000..66e1dfed4 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html @@ -0,0 +1,37 @@ +<!doctype html> +<html> + <head> + <title><body onerror> - compile error in <script src=data:...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + </script> + <body onerror=" + t.step(function(){ + ran = true; + assert_equals(typeof event, 'string', 'first arg'); + assert_equals(source, 'data:text/javascript,for(;){}', 'second arg'); + assert_equals(typeof lineno, 'number', 'third arg'); + }); + t_col.step(function() { + assert_equals(typeof colno, 'number', 'fourth arg'); + }); + "> + <div id=log></div> + <script src="data:text/javascript,for(;){}"></script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + t_col.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html new file mode 100644 index 000000000..0f65f7399 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title><body onerror> - compile error in <script></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + </script> + <body onerror=" + t.step(function(){ + ran = true; + assert_equals(typeof event, 'string', 'first arg'); + assert_equals(source, location.href, 'second arg'); + assert_equals(typeof lineno, 'number', 'third arg'); + }); + t_col.step(function() { + assert_equals(typeof colno, 'number', 'fourth arg'); + }); + "> + <div id=log></div> + <script> + for(;) {} + </script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + t_col.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html new file mode 100644 index 000000000..faaddd9ed --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title><body onerror> - runtime error in <script></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + </script> + <body onerror=" + t.step(function(){ + ran = true; + assert_equals(typeof event, 'string', 'first arg'); + assert_equals(source, location.href, 'second arg'); + assert_equals(typeof lineno, 'number', 'third arg'); + }); + t_col.step(function(){ + assert_equals(typeof colno, 'number', 'fourth arg'); + }); + "> + <div id=log></div> + <script> + undefined_variable; + </script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + t_col.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html new file mode 100644 index 000000000..14e9a8bc2 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html @@ -0,0 +1,34 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in cross-origin setInterval</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + var interval; + window.onerror = t.step_func(function(a, b, c, d){ + clearInterval(interval); + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + function col_check() { + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + } + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error-in-setInterval.js'); + document.body.appendChild(script); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html new file mode 100644 index 000000000..ba3be9d0a --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html @@ -0,0 +1,32 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in cross-origin setTimeout</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + function col_check() { + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + } + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error-in-setTimeout.js'); + document.body.appendChild(script); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html new file mode 100644 index 000000000..b7e989529 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html @@ -0,0 +1,38 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in <script src=//www1...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error.js'); + document.body.appendChild(script); + onload = function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + }); + }; + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html new file mode 100644 index 000000000..08ce2f348 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in <script src=data:...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, 'data:text/javascript,for(;){}', 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script src="data:text/javascript,for(;){}"></script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html new file mode 100644 index 000000000..864d09fc1 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in attribute</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <p onclick="{"></p> + <script> + t.step(function(){ + var ev = document.createEvent('Event'); + ev.initEvent('click', false, false); + document.querySelector('p').dispatchEvent(ev); + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html new file mode 100644 index 000000000..0b094e71c --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html @@ -0,0 +1,28 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in <body onerror></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var ran = false; + window.onerror = t.step_func(function(){ + ran = true; + }); + </script> + </head> + <body onerror="{"><!-- sets the event handler to null before compiling --> + <div id=log></div> + <script> + for(;) {} + </script> + <script> + t.step(function(){ + assert_false(ran, 'ran'); + t.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html new file mode 100644 index 000000000..39a01335c --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in setInterval</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + var interval; + window.onerror = t.step_func(function(a, b, c, d){ + clearInterval(interval); + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + interval = setInterval("{", 10); + setTimeout(function(){ + t.step(function(){ + clearInterval(interval); + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + }, 20); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html new file mode 100644 index 000000000..879660313 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in setTimeout</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + setTimeout("{", 10); + setTimeout(function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + }, 20); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html new file mode 100644 index 000000000..71c28b584 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in <script src=...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, document.querySelector('script[src="support/syntax-error.js"]').src, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script src="support/syntax-error.js"></script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html new file mode 100644 index 000000000..a4bdfd9c4 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html @@ -0,0 +1,38 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - compile error in <script></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script> + for(;) {} + </script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json new file mode 100644 index 000000000..b49029277 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json @@ -0,0 +1,28 @@ +[ + { + "id": "definitions-0", + "original_id": "definitions-0" + }, + { + "id": "calling-scripts", + "original_id": "calling-scripts" + }, + { + "id": "creating-scripts", + "original_id": "creating-scripts" + }, + { + "id": "killing-scripts", + "original_id": "killing-scripts" + }, + { + "id": "runtime-script-errors", + "original_id": "runtime-script-errors", + "children": [ + { + "id": "runtime-script-errors-in-documents", + "original_id": "runtime-script-errors-in-documents" + } + ] + } +]
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html new file mode 100644 index 000000000..dd97566d7 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html @@ -0,0 +1,34 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in cross-origin setInterval</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + var interval; + window.onerror = t.step_func(function(a, b, c, d){ + clearInterval(interval); + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + function col_check() { + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + } + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable-in-setInterval.js'); + document.body.appendChild(script); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html new file mode 100644 index 000000000..20ee21c61 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html @@ -0,0 +1,32 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in cross-origin setTimeout</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + function col_check() { + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + } + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable-in-setTimeout.js'); + document.body.appendChild(script); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html new file mode 100644 index 000000000..d63aaa6d3 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html @@ -0,0 +1,38 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in <script src=//www1...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(a, 'Script error.', 'first arg'); + assert_equals(b, '', 'second arg'); + assert_equals(c, 0, 'third arg'); + }); + var script = document.createElement('script'); + script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable.js'); + document.body.appendChild(script); + onload = function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(col_value, 0, 'fourth arg'); + t_col.done(); + }); + }; + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html new file mode 100644 index 000000000..485ce90aa --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in <script src=data:...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, 'data:text/javascript,undefined_variable;', 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script src="data:text/javascript,undefined_variable;"></script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html new file mode 100644 index 000000000..b4f69da7a --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in attribute</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <p onclick="undefined_variable;"></p> + <script> + t.step(function(){ + var ev = document.createEvent('Event'); + ev.initEvent('click', false, false); + document.querySelector('p').dispatchEvent(ev); + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html new file mode 100644 index 000000000..e0fd1dcbd --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html @@ -0,0 +1,25 @@ +<!doctype html> +<html> + <head> + <title>runtime error in <body onerror></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var ran = 0; + </script> + </head> + <body onerror="ran++; undefined_variable_in_onerror;"> + <div id=log></div> + <script> + undefined_variable; + </script> + <script> + t.step(function(){ + assert_equals(ran, 1, 'ran'); + t.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html new file mode 100644 index 000000000..fcfb6c597 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in setInterval</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + var interval; + window.onerror = t.step_func(function(a, b, c, d){ + clearInterval(interval); + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + interval = setInterval("undefined_variable;", 10); + setTimeout(function(){ + clearInterval(interval); + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + }, 20); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html new file mode 100644 index 000000000..c0c69ad7c --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in setTimeout</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + setTimeout("undefined_variable;", 10); + setTimeout(function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + }, 20); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html new file mode 100644 index 000000000..150a793b7 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html @@ -0,0 +1,29 @@ +<!doctype html> +<html> + <head> + <title>runtime error in window.onerror</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var ran = 0; + window.onerror = function(){ + ran++; + undefined_variable_in_onerror; + }; + </script> + <script> + undefined_variable; + </script> + <script> + t.step(function(){ + assert_equals(ran, 1, 'ran'); + t.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html new file mode 100644 index 000000000..8f3cfb70b --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in <script src=...></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, document.querySelector('script[src="support/undefined-variable.js"]').src, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script src="support/undefined-variable.js"></script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html new file mode 100644 index 000000000..7907494aa --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html @@ -0,0 +1,38 @@ +<!doctype html> +<html> + <head> + <title>window.onerror - runtime error in <script></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id=log></div> + <script> + setup({allow_uncaught_exception:true}); + var t = async_test(); + var t_col = async_test(document.title+' (column)'); + var ran = false; + var col_value; + window.onerror = t.step_func(function(a, b, c, d){ + ran = true; + col_value = d; + assert_equals(typeof a, 'string', 'first arg'); + assert_equals(b, location.href, 'second arg'); + assert_equals(typeof c, 'number', 'third arg'); + }); + </script> + <script> + undefined_variable; + </script> + <script> + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(function(){ + assert_equals(typeof col_value, 'number', 'fourth arg'); + t_col.done(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js new file mode 100644 index 000000000..812c0daea --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js @@ -0,0 +1,9 @@ +interval = setInterval('{', 10); +setTimeout(function(){ + clearInterval(interval); + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(col_check); +}, 20);
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js new file mode 100644 index 000000000..84eb4fc41 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js @@ -0,0 +1,8 @@ +setTimeout('{', 10); +setTimeout(function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(col_check); +}, 20); diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js new file mode 100644 index 000000000..0f74a6fca --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js @@ -0,0 +1 @@ +for (;) {}
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js new file mode 100644 index 000000000..2950fdb51 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js @@ -0,0 +1,9 @@ +interval = setInterval('undefined_variable;', 10); +setTimeout(function(){ + clearInterval(interval); + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(col_check); +}, 20);
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js new file mode 100644 index 000000000..6350ab62e --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js @@ -0,0 +1,8 @@ +setTimeout('undefined_variable;', 10); +setTimeout(function(){ + t.step(function(){ + assert_true(ran, 'ran'); + t.done(); + }); + t_col.step(col_check); +}, 20); diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js new file mode 100644 index 000000000..e73a62ced --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js @@ -0,0 +1 @@ +undefined_variable;
\ No newline at end of file diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html new file mode 100644 index 000000000..3c21df49c --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html @@ -0,0 +1,40 @@ +<!doctype html> +<html> + <head> + <title>window.onerror: parse errors</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <!-- + + In https://html.spec.whatwg.org/multipage/#creating-scripts , + step 3 describes parsing the script, and step 5 says: + # Otherwise, report the error using the onerror event handler of + # the script's global object. If the error is still not handled + # after this, then the error may be reported to the user. + which links to + https://html.spec.whatwg.org/multipage/#report-the-error , + which describes what to do when onerror is a Function. + + --> + </head> + <body> + + <div id="log"></div> + <script> + setup({allow_uncaught_exception:true}); + var error_count = 0; + window.onerror = function(msg, url, lineno) { + ++error_count; + test(function() {assert_equals(url, window.location.href)}, + "correct url passed to window.onerror"); + test(function() {assert_equals(lineno, 34)}, + "correct line number passed to window.onerror"); + }; + </script> + <script>This script does not parse correctly.</script> + <script> + test(function() {assert_equals(error_count, 1)}, + "correct number of calls to window.onerror"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html new file mode 100644 index 000000000..5d2ef0d29 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html @@ -0,0 +1,39 @@ +<!doctype html> +<html> + <head> + <title>window.onerror: runtime scripterrors</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <!-- + + https://html.spec.whatwg.org/multipage/#runtime-script-errors + says what to do for uncaught runtime script errors, and just below + describes what to do when onerror is a Function. + + --> + </head> + <body> + + <div id="log"></div> + <script> + setup({allow_uncaught_exception:true}); + var error_count = 0; + window.onerror = function(msg, url, lineno) { + ++error_count; + }; + </script> + <script> + try { + // This error is caught, so it should NOT trigger onerror. + throw "foo"; + } catch (ex) { + } + // This error is NOT caught, so it should trigger onerror. + throw "bar"; + </script> + <script> + test(function() {assert_equals(error_count, 1)}, + "correct number of calls to window.onerror"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html new file mode 100644 index 000000000..1fdab521a --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html @@ -0,0 +1,43 @@ +<!doctype html> +<html> + <head> + <title>window.onerror: runtime scripterrors</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <!-- + + https://html.spec.whatwg.org/multipage/#runtime-script-errors + says what to do for uncaught runtime script errors, and just below + describes what to do when onerror is a Function. + + --> + </head> + <body> + + <div id="log"></div> + <script> + setup({allow_uncaught_exception:true}); + var error_count = 0; + window.onerror = function(msg, url, lineno) { + ++error_count; + test(function() {assert_equals(url, window.location.href)}, + "correct url passed to window.onerror"); + test(function() {assert_equals(lineno, 36)}, + "correct line number passed to window.onerror"); + }; + </script> + <script> + try { + // This error is caught, so it should NOT trigger onerror. + window.nonexistentproperty.oops(); + } catch (ex) { + } + // This error is NOT caught, so it should trigger onerror. + window.nonexistentproperty.oops(); + </script> + <script> + test(function() {assert_equals(error_count, 1)}, + "correct number of calls to window.onerror"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html new file mode 100644 index 000000000..65a1a02b1 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset=utf-8> +<title> + When a listener from window A is added to an event target in window B via the + addEventListener function from window B, errors in that listener should be + reported to window A. +</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe></iframe> +<iframe></iframe> +<script> +test(function() { + var f = new frames[0].Function("thereIsNoSuchCallable()"); + frames[1].document.addEventListener("myevent", f); + var frame0ErrorFired = false; + var frame1ErrorFired = false; + var ourErrorFired = false; + frames[0].addEventListener("error", function() { + frame0ErrorFired = true; + }); + frames[1].addEventListener("error", function() { + frame1ErrorFired = true; + }); + addEventListener("error", function() { + ourErrorFired = true; + }); + frames[1].document.dispatchEvent(new Event("myevent")); + assert_true(frame0ErrorFired); + assert_false(frame1ErrorFired); + assert_false(ourErrorFired); +}, "The error event from an event listener should fire on that listener's global"); +</script> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html new file mode 100644 index 000000000..6c5476542 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset=utf-8> +<title> + When a listener from window A is added to an event target in window B via the + addEventListener function from window A, errors in that listener should be + reported to window A. +</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe></iframe> +<iframe></iframe> +<script> +test(function() { + var f = new frames[0].Function("thereIsNoSuchCallable()"); + frames[0].document.addEventListener.call(frames[1].document, "myevent", f); + var frame0ErrorFired = false; + var frame1ErrorFired = false; + var ourErrorFired = false; + frames[0].addEventListener("error", function() { + frame0ErrorFired = true; + }); + frames[1].addEventListener("error", function() { + frame1ErrorFired = true; + }); + addEventListener("error", function() { + ourErrorFired = true; + }); + frames[1].document.dispatchEvent(new Event("myevent")); + assert_true(frame0ErrorFired); + assert_false(frame1ErrorFired); + assert_false(ourErrorFired); +}, "The error event from an event listener should fire on that listener's global"); +</script> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html new file mode 100644 index 000000000..5e78baa8d --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset=utf-8> +<title> + When a listener from window A is added to an event target in window A via the + addEventListener function from window A, errors in that listener should be + reported to window A. +</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe></iframe> +<iframe></iframe> +<script> +test(function() { + var f = new frames[1].Function("thereIsNoSuchCallable()"); + frames[1].document.addEventListener("myevent", f); + var frame0ErrorFired = false; + var frame1ErrorFired = false; + var ourErrorFired = false; + frames[0].addEventListener("error", function() { + frame0ErrorFired = true; + }); + frames[1].addEventListener("error", function() { + frame1ErrorFired = true; + }); + addEventListener("error", function() { + ourErrorFired = true; + }); + frames[1].document.dispatchEvent(new Event("myevent")); + assert_false(frame0ErrorFired); + assert_true(frame1ErrorFired); + assert_false(ourErrorFired); +}, "The error event from an event listener should fire on that listener's global"); +</script> diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html new file mode 100644 index 000000000..a5f35d613 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset=utf-8> +<title> + When a listener from window A is added to an event target in window A via the + addEventListener function from window B, errors in that listener should be + reported to window A. +</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe></iframe> +<iframe></iframe> +<script> +test(function() { + var f = new frames[1].Function("thereIsNoSuchCallable()"); + frames[0].document.addEventListener.call(frames[1].document, "myevent", f); + var frame0ErrorFired = false; + var frame1ErrorFired = false; + var ourErrorFired = false; + frames[0].addEventListener("error", function() { + frame0ErrorFired = true; + }); + frames[1].addEventListener("error", function() { + frame1ErrorFired = true; + }); + addEventListener("error", function() { + ourErrorFired = true; + }); + frames[1].document.dispatchEvent(new Event("myevent")); + assert_false(frame0ErrorFired); + assert_true(frame1ErrorFired); + assert_false(ourErrorFired); +}, "The error event from an event listener should fire on that listener's global"); +</script> |