зеркало из https://github.com/mozilla/gecko-dev.git
Bug 764718 - Part 3: Test for calling window.close() on a window opened by window.open from <iframe mozbrowser>. r=bz
This commit is contained in:
Родитель
837cab5eb4
Коммит
a39a8108c0
|
@ -48,6 +48,9 @@ _TEST_FILES = \
|
|||
test_browserElement_inproc_PromptConfirm.html \
|
||||
browserElement_Close.js \
|
||||
test_browserElement_inproc_Close.html \
|
||||
browserElement_CloseFromOpener.js \
|
||||
test_browserElement_inproc_CloseFromOpener.html \
|
||||
file_browserElement_CloseFromOpener.html \
|
||||
browserElement_OpenWindow.js \
|
||||
test_browserElement_inproc_OpenWindow.html \
|
||||
file_browserElement_Open1.html \
|
||||
|
@ -77,6 +80,7 @@ _TEST_FILES += \
|
|||
test_browserElement_oop_PromptCheck.html \
|
||||
test_browserElement_oop_PromptConfirm.html \
|
||||
test_browserElement_oop_Close.html \
|
||||
test_browserElement_oop_CloseFromOpener.html \
|
||||
test_browserElement_oop_OpenWindow.html \
|
||||
test_browserElement_oop_OpenWindowRejected.html \
|
||||
test_browserElement_oop_SecurityChange.html \
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Bug 764718 - Test that window.close() works from the opener window.
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addToWhitelist();
|
||||
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.mozbrowser = true;
|
||||
|
||||
iframe.addEventListener('mozbrowseropenwindow', function(e) {
|
||||
ok(true, "got openwindow event.");
|
||||
document.body.appendChild(e.detail.frameElement);
|
||||
|
||||
e.detail.frameElement.addEventListener("mozbrowserclose", function(e) {
|
||||
ok(true, "got mozbrowserclose event.");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
// file_browserElement_CloseFromOpener opens a new window and then calls
|
||||
// close() on it.
|
||||
iframe.src = "file_browserElement_CloseFromOpener.html";
|
||||
}
|
||||
|
||||
runTest();
|
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<body>
|
||||
<script>
|
||||
var win = window.open('file_empty.html');
|
||||
win.close();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=757182
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 757182</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=757182">Mozilla Bug 757182</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_CloseFromOpener.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=757182
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 757182</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=757182">Mozilla Bug 757182</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src="browserElement_CloseFromOpener.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче