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: |