зеркало из https://github.com/mozilla/gecko-dev.git
Bug 766481 - Part 2: Tests for alert() from inside an <iframe> inside an <iframe mozbrowser>. r=mounir
--HG-- extra : rebase_source : b306e57989ce18be78a1e44a49d32556d62a08e2
This commit is contained in:
Родитель
413ce8b682
Коммит
06a92f0310
|
@ -42,6 +42,10 @@ _TEST_FILES = \
|
||||||
test_browserElement_inproc_KeyEvents.html \
|
test_browserElement_inproc_KeyEvents.html \
|
||||||
browserElement_Alert.js \
|
browserElement_Alert.js \
|
||||||
test_browserElement_inproc_Alert.html \
|
test_browserElement_inproc_Alert.html \
|
||||||
|
browserElement_AlertInFrame.js \
|
||||||
|
test_browserElement_inproc_AlertInFrame.html \
|
||||||
|
file_browserElement_AlertInFrame.html \
|
||||||
|
file_browserElement_AlertInFrame_Inner.html \
|
||||||
browserElement_PromptCheck.js \
|
browserElement_PromptCheck.js \
|
||||||
test_browserElement_inproc_PromptCheck.html \
|
test_browserElement_inproc_PromptCheck.html \
|
||||||
browserElement_PromptConfirm.js \
|
browserElement_PromptConfirm.js \
|
||||||
|
@ -75,6 +79,7 @@ _TEST_FILES += \
|
||||||
test_browserElement_oop_SetVisible.html \
|
test_browserElement_oop_SetVisible.html \
|
||||||
test_browserElement_oop_KeyEvents.html \
|
test_browserElement_oop_KeyEvents.html \
|
||||||
test_browserElement_oop_Alert.html \
|
test_browserElement_oop_Alert.html \
|
||||||
|
test_browserElement_oop_AlertInFrame.html \
|
||||||
test_browserElement_oop_PromptCheck.html \
|
test_browserElement_oop_PromptCheck.html \
|
||||||
test_browserElement_oop_PromptConfirm.html \
|
test_browserElement_oop_PromptConfirm.html \
|
||||||
test_browserElement_oop_Close.html \
|
test_browserElement_oop_Close.html \
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
/* Any copyright is dedicated to the public domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
// Test that alert works from inside an <iframe> inside an <iframe mozbrowser>.
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
|
function runTest() {
|
||||||
|
browserElementTestHelpers.setEnabledPref(true);
|
||||||
|
browserElementTestHelpers.addToWhitelist();
|
||||||
|
|
||||||
|
var iframe = document.createElement('iframe');
|
||||||
|
iframe.mozbrowser = true;
|
||||||
|
|
||||||
|
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
|
||||||
|
is(e.detail.message, 'Hello');
|
||||||
|
SimpleTest.finish();
|
||||||
|
});
|
||||||
|
|
||||||
|
iframe.src = 'file_browserElement_AlertInFrame.html';
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
}
|
||||||
|
|
||||||
|
runTest();
|
|
@ -0,0 +1,6 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
I'm file_browserElement_AlertInFrame.html.
|
||||||
|
<iframe src='file_browserElement_AlertInFrame_Inner.html'></iframe>
|
||||||
|
<body>
|
||||||
|
</html>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
I'm file_browserElement_AlertInFrame_Inner.html.
|
||||||
|
|
||||||
|
<script>
|
||||||
|
alert("Hello");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Test for iframe mozbrowser</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>
|
||||||
|
<script type="application/javascript;version=1.7" src="browserElement_AlertInFrame.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Test for iframe mozbrowser</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>
|
||||||
|
<script type="application/javascript;version=1.7" src="browserElement_AlertInFrame.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче