summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/nested_setup.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/mochitest/nested_setup.js')
-rw-r--r--testing/mochitest/nested_setup.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/mochitest/nested_setup.js b/testing/mochitest/nested_setup.js
new file mode 100644
index 000000000..d42eaf944
--- /dev/null
+++ b/testing/mochitest/nested_setup.js
@@ -0,0 +1,31 @@
+
+var gTestURL = '';
+
+function addPermissions()
+{
+ SpecialPowers.pushPermissions(
+ [{ type: "browser", allow: true, context: document }],
+ addPreferences);
+}
+
+function addPreferences()
+{
+ SpecialPowers.pushPrefEnv(
+ {"set": [["dom.mozBrowserFramesEnabled", true]]},
+ insertFrame);
+}
+
+function insertFrame()
+{
+ SpecialPowers.nestedFrameSetup();
+
+ var iframe = document.createElement('iframe');
+ iframe.id = 'nested-parent-frame';
+ iframe.width = "100%";
+ iframe.height = "100%";
+ iframe.scoring = "no";
+ iframe.setAttribute("remote", "true");
+ iframe.setAttribute("mozbrowser", "true");
+ iframe.src = gTestURL;
+ document.getElementById("holder-div").appendChild(iframe);
+} \ No newline at end of file