summaryrefslogtreecommitdiffstats
path: root/dom/browser-element/mochitest/browserElement_ForwardName.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/browser-element/mochitest/browserElement_ForwardName.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/browser-element/mochitest/browserElement_ForwardName.js')
-rw-r--r--dom/browser-element/mochitest/browserElement_ForwardName.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/dom/browser-element/mochitest/browserElement_ForwardName.js b/dom/browser-element/mochitest/browserElement_ForwardName.js
new file mode 100644
index 000000000..326c1ef24
--- /dev/null
+++ b/dom/browser-element/mochitest/browserElement_ForwardName.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the public domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Bug 781320 - Test that the name in <iframe mozbrowser name="foo"> is
+// forwarded down to remote mozbrowsers.
+
+"use strict";
+
+SimpleTest.waitForExplicitFinish();
+browserElementTestHelpers.setEnabledPref(true);
+browserElementTestHelpers.addPermission();
+
+function runTest() {
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('mozbrowser', 'true');
+ iframe.setAttribute('name', 'foo');
+
+ iframe.addEventListener("mozbrowseropenwindow", function(e) {
+ ok(false, 'Got mozbrowseropenwindow, but should not have.');
+ });
+
+ iframe.addEventListener('mozbrowserlocationchange', function(e) {
+ ok(true, "Got locationchange to " + e.detail.url);
+ if (e.detail.url.endsWith("ForwardName.html#finish")) {
+ SimpleTest.finish();
+ }
+ });
+
+ // The file sends us messages via alert() that start with "success:" or
+ // "failure:".
+ iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+ ok(e.detail.message.startsWith('success:'), e.detail.message);
+ });
+
+ document.body.appendChild(iframe);
+
+ // This file does window.open('file_browserElement_ForwardName.html#finish',
+ // 'foo'); That should open in the curent window, because the window should
+ // be named foo.
+ iframe.src = 'file_browserElement_ForwardName.html';
+}
+
+addEventListener('testready', runTest);