blob: d31b6c2f32526fa2880afaa3ea3ba11b11476a33 (
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
35
36
37
38
39
40
41
42
43
44
45
46
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();
});
|