Bug 766481 - Part 2: Tests for alert() from inside an <iframe> inside an <iframe mozbrowser>. r=mounir
authorJustin Lebar <justin.lebar@gmail.com>
Sat, 23 Jun 2012 11:05:12 -0400
changeset 106398 96aacfacb5ed5360791024231dc3bf2a3890f50c
parent 106397 0ea3c8962c743ee2a83867c0d6c6c2611694647f
child 106399 6222b149e94e14997ab0d65afe338e22ee614883
push id23447
push userdanderson@mozilla.com
push dateTue, 11 Sep 2012 17:34:27 +0000
treeherdermozilla-central@fdfaef738a00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs766481
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 766481 - Part 2: Tests for alert() from inside an <iframe> inside an <iframe mozbrowser>. r=mounir
content/base/src/nsINode.cpp
dom/browser-element/mochitest/Makefile.in
dom/browser-element/mochitest/browserElement_AlertInFrame.js
dom/browser-element/mochitest/file_browserElement_AlertInFrame.html
dom/browser-element/mochitest/file_browserElement_AlertInFrame_Inner.html
dom/browser-element/mochitest/test_browserElement_inproc_AlertInFrame.html
dom/browser-element/mochitest/test_browserElement_oop_AlertInFrame.html
--- a/dom/browser-element/mochitest/Makefile.in
+++ b/dom/browser-element/mochitest/Makefile.in
@@ -37,16 +37,20 @@ include $(topsrcdir)/config/rules.mk
 		browserElement_GetScreenshot.js \
 		test_browserElement_inproc_GetScreenshot.html \
 		browserElement_SetVisible.js \
 		test_browserElement_inproc_SetVisible.html \
 		browserElement_KeyEvents.js \
 		test_browserElement_inproc_KeyEvents.html \
 		browserElement_Alert.js \
 		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 \
 		test_browserElement_inproc_PromptCheck.html \
 		browserElement_PromptConfirm.js \
 		test_browserElement_inproc_PromptConfirm.html \
 		browserElement_Close.js \
 		test_browserElement_inproc_Close.html \
 		browserElement_OpenWindow.js \
 		test_browserElement_inproc_OpenWindow.html \
@@ -70,16 +74,17 @@ ifneq ($(OS_ARCH),WINNT)
 		test_browserElement_oop_DataURI.html \
 		test_browserElement_oop_Titlechange.html \
 		test_browserElement_oop_TopBarrier.html \
 		test_browserElement_oop_Iconchange.html \
 		test_browserElement_oop_GetScreenshot.html \
 		test_browserElement_oop_SetVisible.html \
 		test_browserElement_oop_KeyEvents.html \
 		test_browserElement_oop_Alert.html \
+		test_browserElement_oop_AlertInFrame.html \
 		test_browserElement_oop_PromptCheck.html \
 		test_browserElement_oop_PromptConfirm.html \
 		test_browserElement_oop_Close.html \
 		test_browserElement_oop_OpenWindow.html \
 		test_browserElement_oop_OpenWindowRejected.html \
 		test_browserElement_oop_SecurityChange.html \
 		test_browserElement_oop_BackForward.html \
 		$(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/browserElement_AlertInFrame.js
@@ -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();
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/file_browserElement_AlertInFrame.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+I'm file_browserElement_AlertInFrame.html.
+<iframe src='file_browserElement_AlertInFrame_Inner.html'></iframe>
+<body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/file_browserElement_AlertInFrame_Inner.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+I'm file_browserElement_AlertInFrame_Inner.html.
+
+<script>
+alert("Hello");
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/test_browserElement_inproc_AlertInFrame.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>
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/test_browserElement_oop_AlertInFrame.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>