summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/bugs/test_bug534149.html
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/tests/mochitest/bugs/test_bug534149.html
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/tests/mochitest/bugs/test_bug534149.html')
-rw-r--r--dom/tests/mochitest/bugs/test_bug534149.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/dom/tests/mochitest/bugs/test_bug534149.html b/dom/tests/mochitest/bugs/test_bug534149.html
new file mode 100644
index 000000000..9c9506045
--- /dev/null
+++ b/dom/tests/mochitest/bugs/test_bug534149.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=534149
+-->
+<head>
+ <title>Test for Bug 534149</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=534149">Mozilla Bug 534149</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 534149 **/
+function getIDs(iframe) {
+ var win = iframe.contentWindow;
+ // Force inner creation
+ win.document;
+
+ var util = SpecialPowers.getDOMWindowUtils(win);
+ return [util.outerWindowID, util.currentInnerWindowID];
+}
+
+var i1 = document.createElement("iframe");
+var i2 = document.createElement("iframe");
+
+document.body.appendChild(i1);
+var [i1outer, i1inner] = getIDs(i1);
+
+document.body.appendChild(i2);
+var [i2outer, i2inner] = getIDs(i2);
+
+is(i1inner, i1outer + 1, "For frame 1, inner should come right after outer");
+is(i2inner, i2outer + 1, "For frame 2, inner should come right after outer");
+is(i2outer, i1inner + 1, "Frame 2 comes right after frame 1");
+
+var innerWindowDestroyID;
+var outerWindowDestroyID;
+
+var outerObserver = {
+ observe: function(id) {
+ outerWindowDestroyID =
+ SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
+ }
+};
+var innerObserver = {
+ observe: function(id) {
+ innerWindowDestroyID =
+ SpecialPowers.wrap(id).QueryInterface(SpecialPowers.Ci.nsISupportsPRUint64).data;
+ }
+};
+
+function removeFrame(iframe) {
+ SpecialPowers.addObserver(outerObserver, "outer-window-destroyed", false);
+ SpecialPowers.addObserver(innerObserver, "inner-window-destroyed", false);
+
+ iframe.parentNode.removeChild(iframe);
+}
+
+removeFrame(i1);
+SimpleTest.waitForExplicitFinish();
+SimpleTest.executeSoon(function() {
+ is(innerWindowDestroyID, i1inner, "inner window of frame 1 should be destroyed");
+ is(outerWindowDestroyID, i1outer, "outer window of frame 1 should be destroyed");
+ SpecialPowers.removeObserver(outerObserver, "outer-window-destroyed");
+ SpecialPowers.removeObserver(innerObserver, "inner-window-destroyed");
+ SimpleTest.finish();
+});
+
+
+</script>
+</pre>
+</body>
+</html>