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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers4.html

Issue 2379313002: Fix 'noopener' targeting and return value. (Closed)
Patch Set: Rebase Created 4 years, 2 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 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script> 4 <script>
5 var newWindow; 5 var newWindow;
6 6
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 testRunner.setCanOpenWindows(); 9 testRunner.setCanOpenWindows();
10 testRunner.waitUntilDone(); 10 testRunner.waitUntilDone();
11 testRunner.setPopupBlockingEnabled(true); 11 testRunner.setPopupBlockingEnabled(true);
12 } 12 }
13 13
14 function clickHandler() { 14 function clickHandler() {
15 setTimeout(function() { 15 setTimeout(function() {
16 setTimeout(function() { 16 setTimeout(function() {
17 newWindow = window.open("about:blank"); 17 newWindow = window.open("about:blank");
18 self.focus(); 18 self.focus();
19 debug("Test calling window.open() in a nested call to setTim eout(). A popup should not be allowed.") 19 debug("Test calling window.open() in a nested call to setTim eout(). A popup should not be allowed.")
20 shouldBeUndefined("newWindow"); 20 shouldBeNull("newWindow");
21 if (window.testRunner) 21 if (window.testRunner)
22 testRunner.notifyDone(); 22 testRunner.notifyDone();
23 }, 0); 23 }, 0);
24 }, 300); 24 }, 300);
25 } 25 }
26 26
27 function clickButton() { 27 function clickButton() {
28 var button = document.getElementById("test"); 28 var button = document.getElementById("test");
29 var buttonX = button.offsetLeft + button.offsetWidth / 2; 29 var buttonX = button.offsetLeft + button.offsetWidth / 2;
30 var buttonY = button.offsetTop + button.offsetHeight / 2; 30 var buttonY = button.offsetTop + button.offsetHeight / 2;
31 if (window.eventSender) { 31 if (window.eventSender) {
32 eventSender.mouseMoveTo(buttonX, buttonY); 32 eventSender.mouseMoveTo(buttonX, buttonY);
33 eventSender.mouseDown(); 33 eventSender.mouseDown();
34 eventSender.mouseUp(); 34 eventSender.mouseUp();
35 } 35 }
36 } 36 }
37 </script> 37 </script>
38 </head> 38 </head>
39 <body onload="clickButton()"> 39 <body onload="clickButton()">
40 <button id="test" onclick="clickHandler()">Click Here</button> 40 <button id="test" onclick="clickHandler()">Click Here</button>
41 <div id="console"></div> 41 <div id="console"></div>
42 </body> 42 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698