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

Unified Diff: LayoutTests/fast/events/popup-forwarded-postmessage-blocked.html

Issue 258783004: Add a "forwarded" flag to usergesture tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix unittest Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/popup-forwarded-postmessage-blocked-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/popup-forwarded-postmessage-blocked.html
diff --git a/LayoutTests/fast/events/popup-blocking-timers6.html b/LayoutTests/fast/events/popup-forwarded-postmessage-blocked.html
similarity index 79%
copy from LayoutTests/fast/events/popup-blocking-timers6.html
copy to LayoutTests/fast/events/popup-forwarded-postmessage-blocked.html
index 75891cac7e3b35a63fb3cb25c009ceb54328bb04..9db6c89605aa94183f0ec7eabbe88ac13b80c776 100644
--- a/LayoutTests/fast/events/popup-blocking-timers6.html
+++ b/LayoutTests/fast/events/popup-forwarded-postmessage-blocked.html
@@ -3,28 +3,31 @@
<script src="../../resources/js-test.js"></script>
<script>
var newWindow;
-
+
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.waitUntilDone();
testRunner.setPopupBlockingEnabled(true);
}
-
+
function clickHandler() {
setTimeout(function() {
+ window.postMessage({}, "*");
+ }, 300);
+ }
+
+ window.onmessage = function(event) {
+ setTimeout(function() {
newWindow = window.open("about:blank");
self.focus();
- debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.")
+ debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.")
shouldBeUndefined("newWindow");
-
if (window.testRunner)
testRunner.notifyDone();
- }, 1001);
- if (window.eventSender)
- eventSender.leapForward(1001);
- }
-
+ }, 0);
+ };
+
function clickButton() {
var button = document.getElementById("test");
var buttonX = button.offsetLeft + button.offsetWidth / 2;
@@ -34,7 +37,7 @@
eventSender.mouseDown();
eventSender.mouseUp();
}
- }
+ }
</script>
</head>
<body onload="clickButton()">
« no previous file with comments | « no previous file | LayoutTests/fast/events/popup-forwarded-postmessage-blocked-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698