Commit 649a9edd authored by kmccullo's avatar kmccullo
Browse files

Reviewed by.

        - Fixed build breakage.

        * fast/dom/open-and-close-by-DOM-expected.txt: Added.
        * fast/dom/open-and-close-by-DOM.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aed6bd6a
2007-05-23 Kevin McCullough <kmccullough@apple.com>
Reviewed by.
- Fixed build breakage.
* fast/dom/open-and-close-by-DOM-expected.txt: Added.
* fast/dom/open-and-close-by-DOM.html: Added.
2007-05-23 Kevin McCullough <kmccullough@apple.com>
 
Reviewed by.
ALERT: Middle Window Opened
ALERT: Close Window Opened
This test checks that a window which has been opened by the DOM can also be closed byt the DOM. The test will run automatically with popup blocking disabled. To run the test manually click the link below.
Open new window that will close itself
TEST PASSED
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.setCanOpenWindows();
layoutTestController.waitUntilDone();
}
var start;
var myInterval;
//This function should only be used with DRT and thus layoutTestController
function checkIfDone() {
var numOpenWindows = layoutTestController.windowCount();
var now = new Date();
if (numOpenWindows == 1) {
var span = document.createElement("span");
span.innerHTML = 'TEST PASSED <br>';
document.getElementById("console").appendChild(span);
clearInterval(myInterval);
layoutTestController.notifyDone();
} else if (now - start > 10000) {
var span = document.createElement("span");
span.innerHTML = 'TEST FAILED <br> Number of open windows: ' + numOpenWindows + '<br/>';
document.getElementById("console").appendChild(span);
clearInterval(myInterval);
layoutTestController.notifyDone();
}
}
function openNewWindow() {
var event = document.createEvent('MouseEvent');
event.initEvent( 'click', true, true );
document.getElementById('anchorLink').dispatchEvent(event);
if (window.layoutTestController) {
layoutTestController.setCloseRemainingWindowsWhenComplete();
start = new Date();
myInterval = setInterval(checkIfDone, 500);
}
}
</script>
</head>
<body onload="openNewWindow()">
This test checks that a window which has been opened by the DOM can also be closed
byt the DOM. The test will run automatically with popup blocking disabled.
To run the test manually click the link below.
<br/>
<div id="console" />
<br/>
<a href="resources/middle.html" id="anchorLink" target="_blank">Open new window that will close itself</a>
<br/><br/>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment