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

Unified Diff: LayoutTests/http/tests/misc/set-window-opener-to-null.html

Issue 475933003: Remove testRunner.globalFlag use from layout tests outside http/security (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Just use onload Created 6 years, 4 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 | « LayoutTests/http/tests/misc/resources/content-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/misc/set-window-opener-to-null.html
diff --git a/LayoutTests/http/tests/misc/set-window-opener-to-null.html b/LayoutTests/http/tests/misc/set-window-opener-to-null.html
index e9439048dea748f76749b5eae4d881182686d69e..60a2d4bc404a5c24f7185c80b4a1cbad19b26b71 100644
--- a/LayoutTests/http/tests/misc/set-window-opener-to-null.html
+++ b/LayoutTests/http/tests/misc/set-window-opener-to-null.html
@@ -4,31 +4,9 @@ if (window.testRunner) {
testRunner.setCanOpenWindows();
testRunner.dumpAsText();
testRunner.waitUntilDone();
- testRunner.globalFlag = false;
}
-var w = window.open("http://127.0.0.1:8000/misc/resources/content-iframe.html");
-w.opener = null;
-
-function wait_to_start() {
- var child_window_opened;
-
- // polling testRunner.globalFlag or w.document
- if (window.testRunner) {
- child_window_opened = testRunner.globalFlag;
- } else {
- // polling w.document is not very reliable cross browsers,
- // it works in chrome for manual testsing.
- // We might want to change it to using postMessage when it
- // is supported.
- child_window_opened = !w.document;
- }
-
- if (!child_window_opened) {
- setTimeout(wait_to_start, 30);
- return;
- }
-
+function runTest() {
var e = document.getElementById('console');
e.innerHTML = w.opener == null ? 'PASS' : 'FAIL';
@@ -38,8 +16,9 @@ function wait_to_start() {
testRunner.notifyDone();
}
-window.onload = wait_to_start;
-
+var w = window.open('http://127.0.0.1:8000/misc/resources/content-iframe.html');
+w.opener = null;
+w.onload = runTest;
</script>
<body>
This tests that following code works in Chrome:
« no previous file with comments | « LayoutTests/http/tests/misc/resources/content-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698