Use special powers quit in unit tests.
This commit is contained in:
parent
da522d42d4
commit
70ce3a88a1
@ -5,7 +5,7 @@
|
|||||||
var TestReporter = function(browser, appPath) {
|
var TestReporter = function(browser, appPath) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function send(action, json) {
|
function send(action, json, cb) {
|
||||||
var r = new XMLHttpRequest();
|
var r = new XMLHttpRequest();
|
||||||
// (The POST URI is ignored atm.)
|
// (The POST URI is ignored atm.)
|
||||||
r.open('POST', action, true);
|
r.open('POST', action, true);
|
||||||
@ -14,7 +14,11 @@ var TestReporter = function(browser, appPath) {
|
|||||||
if (r.readyState == 4) {
|
if (r.readyState == 4) {
|
||||||
// Retry until successful
|
// Retry until successful
|
||||||
if (r.status !== 200) {
|
if (r.status !== 200) {
|
||||||
send(action, json);
|
send(action, json, cb);
|
||||||
|
} else {
|
||||||
|
if (cb) {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -38,7 +42,11 @@ var TestReporter = function(browser, appPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendQuitRequest() {
|
function sendQuitRequest() {
|
||||||
send('/tellMeToQuit?path=' + escape(appPath), {});
|
send('/tellMeToQuit?path=' + escape(appPath), {}, function () {
|
||||||
|
if (window.SpecialPowers) {
|
||||||
|
SpecialPowers.quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.now = function() {
|
this.now = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user