summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/nested_setup.js
blob: d42eaf9448f884abc50265920a32211617008f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
}