summaryrefslogtreecommitdiffstats
path: root/dom/browser-element/mochitest/file_browserElement_Open1.html
blob: c74415e2e281e0a2f4bb97f4abe10b12a3b32a87 (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
32
33
34
<html>
<body>
<script>

// Because this file is inside <iframe mozbrowser>, the alert() calls below
// don't trigger actual dialogs.  Instead, the document which contans the
// iframe receives mozbrowsershowmodalprompt events, which the document uses
// to determine test success/failure.

function is(x, y, reason) {
  if (x === y)  {
    alert("success: " + x + " === " + y + ", " + reason);
  }
  else {
    alert("failure: " + x + " !== " + y + ", " + reason);
  }
}

function ok(bool, reason) {
  alert((bool ? "success: " : "failure: ") + reason);
}

// Send "dialog=1" as a test for bug 783644.  It shouldn't have any effect.
var w = window.open("file_browserElement_Open2.html", "name", "dialog=1");
w.addEventListener("load", function() {
  ok(true, "got load");
  is(w.opener, window, 'opener property');
  is(w.location.href, location.href.replace('Open1', 'Open2'), 'correct location');
  is(w.document.getElementById('testElem').innerHTML, 'test', 'elem innerHTML');
  alert("finish");
});
</script>
</body>
</html>