summaryrefslogtreecommitdiffstats
path: root/dom/settings/tests/file_bug1110872.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/settings/tests/file_bug1110872.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/settings/tests/file_bug1110872.js')
-rw-r--r--dom/settings/tests/file_bug1110872.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/settings/tests/file_bug1110872.js b/dom/settings/tests/file_bug1110872.js
new file mode 100644
index 000000000..d31b6c2f3
--- /dev/null
+++ b/dom/settings/tests/file_bug1110872.js
@@ -0,0 +1,47 @@
+"use strict";
+
+SimpleTest.waitForExplicitFinish();
+
+var iframe;
+var loadedEvents = 0;
+
+function loadServer() {
+ var url = SimpleTest.getTestFileURL("file_loadserver.js");
+ var script = SpecialPowers.loadChromeScript(url);
+}
+
+function runTest() {
+ iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ iframe.addEventListener('load', mozbrowserLoaded);
+ iframe.src = 'file_bug1110872.html';
+}
+
+function iframeBodyRecv(msg) {
+ switch (loadedEvents) {
+ case 1:
+ // If we get a message back before we've seen 2 loads, that means
+ // something went wrong with the test. Fail immediately.
+ ok(true, 'got response from first test!');
+ break;
+ case 2:
+ // If we get a message back after 2 loads (initial load, reload),
+ // it means the callback for the last lock fired, which means the
+ // SettingsRequestManager queue has to have been cleared
+ // correctly.
+ ok(true, 'further queries returned ok after SettingsManager death');
+ SimpleTest.finish();
+ break;
+ }
+}
+
+function mozbrowserLoaded() {
+ loadedEvents++;
+ iframe.contentWindow.postMessage({name: "start", step: loadedEvents}, '*');
+ window.addEventListener('message', iframeBodyRecv);
+}
+
+window.addEventListener("load", function() {
+ loadServer();
+ runTest();
+});