5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.setCanOpenWindows(true);
8 testRunner
.overridePreference('WebKitSupportsMultipleWindows', false);
9 testRunner
.waitUntilDone();
14 var event
= document
.createEvent('MouseEvent');
15 event
.initEvent('click', true, true);
16 elmt
.dispatchEvent(event
);
21 if (window
.testRunner
)
22 var windowCount
= testRunner
.windowCount();
23 var link
= document
.getElementById("link");
25 if (window
.testRunner
) {
26 if (windowCount
!= testRunner
.windowCount())
27 document
.writeln('FAIL: Popup opened in a new window');
29 document
.writeln('PASS: Popup opened in the same window');
30 testRunner
.notifyDone();
34 window
.addEventListener('load', runTest
, true);
38 You need popups to be enabled to run this test.
39 <a id=
"link" target=
"_blank" href=
"data:text/html;charset=utf-8,<html><body>The test passes if this page opens in the same window</body></html>">Click me!
</a>