Commit e3681b65 authored by kmccullo's avatar kmccullo
Browse files

Reviewed by.

        - Forgot to checkin for fix for rdar://problem/4981886

        * fast/dom/open-and-close-by-DOM-expected.txt: Added.
        * fast/dom/open-and-close-by-DOM.html: Added.
        * fast/dom/resources/close.html: Added.
        * fast/dom/resources/middle.html: Added.
        * http/tests/security/local-image-from-remote.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 00b7e557
2007-05-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by.
- Forgot to checkin for fix for rdar://problem/4981886
* fast/dom/open-and-close-by-DOM-expected.txt: Added.
* fast/dom/open-and-close-by-DOM.html: Added.
* fast/dom/resources/close.html: Added.
* fast/dom/resources/middle.html: Added.
* http/tests/security/local-image-from-remote.html:
2007-05-22 Justin Garcia <justin.garcia@apple.com>
 
Reviewed by oliver
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
============== Back Forward List ==============
curr-> file:///Volumes/Data/Pyong/src/trunk/OpenSource/LayoutTests/fast/dom/open-and-close-by-DOM.html **nav target**
===============================================
<!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.dumpBackForwardList();
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>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script>
function closeThisWindow() {
alert("Close Window Opened");
self.close();
}
</script>
</head>
<body onload="closeThisWindow()">
This doc should only be opened by middle.html.
<br/>
This doc should automatically close the window.
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script>
function pressSend() {
alert("Middle Window Opened");
document.getElementById('SendButton').click();
}
</script>
</head>
<body onLoad="pressSend()">
This doc should only be opened by open.html.
<br/>
If this doc did not submit itself then this window would have no history and
always be allowed to close. We need to test that the window can close because
it was opened by the DOM.
<br/>
<br/>
If running this test manually, click the send button below if you are not redirected.
<form name="whatever" action="close.html" method="post">
<input name="send" value="Send" id="SendButton" type="submit">
</form>
</body>
</html>
\ No newline at end of file
Supports Markdown
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