Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html

Issue 1924663004: Import web-platform-tests@c969f975ca64b67ebcdddfefa0ef1d7d82680d88 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TestExpectations for web animations instead of skipping Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title> 3 <title>
4 When a listener from window A is added to an event target in window A via the 4 When a listener from window A is added to an event target in window B via the
5 addEventListener function from window A, errors in that listener should be 5 addEventListener function from window B, errors in that listener should be
6 reported to window A. 6 reported to window A.
7 </title> 7 </title>
8 <script src=../../../../../../resources/testharness.js></script> 8 <script src=../../../../../../resources/testharness.js></script>
9 <script src=../../../../../../resources/testharnessreport.js></script> 9 <script src=../../../../../../resources/testharnessreport.js></script>
10 <iframe></iframe> 10 <iframe></iframe>
11 <iframe></iframe> 11 <iframe></iframe>
12 <script> 12 <script>
13 test(function() { 13 test(function() {
14 var f = new frames[1].Function("thereIsNoSuchCallable()"); 14 var f = new frames[0].Function("thereIsNoSuchCallable()");
15 frames[1].document.addEventListener("myevent", f); 15 frames[1].document.addEventListener("myevent", f);
16 var frame0ErrorFired = false; 16 var frame0ErrorFired = false;
17 var frame1ErrorFired = false; 17 var frame1ErrorFired = false;
18 var ourErrorFired = false; 18 var ourErrorFired = false;
19 frames[0].addEventListener("error", function() { 19 frames[0].addEventListener("error", function() {
20 frame0ErrorFired = true; 20 frame0ErrorFired = true;
21 }); 21 });
22 frames[1].addEventListener("error", function() { 22 frames[1].addEventListener("error", function() {
23 frame1ErrorFired = true; 23 frame1ErrorFired = true;
24 }); 24 });
25 addEventListener("error", function() { 25 addEventListener("error", function() {
26 ourErrorFired = true; 26 ourErrorFired = true;
27 }); 27 });
28 frames[1].document.dispatchEvent(new Event("myevent")); 28 frames[1].document.dispatchEvent(new Event("myevent"));
29 assert_false(frame0ErrorFired); 29 assert_true(frame0ErrorFired);
30 assert_true(frame1ErrorFired); 30 assert_false(frame1ErrorFired);
31 assert_false(ourErrorFired); 31 assert_false(ourErrorFired);
32 }, "The error event from an event listener should fire on that listener's global "); 32 }, "The error event from an event listener should fire on that listener's global ");
33 </script> 33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698