Bug 573259: Wait to go online before running browser_relative.js. r=robstrong, a=tests

This commit is contained in:
Dave Townsend 2011-03-08 09:48:15 -08:00
Родитель 010a9e92b9
Коммит 67f03f5702
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -25,6 +25,16 @@ function download_progress(addon, value, maxValue) {
}
function finish_test(count) {
function wait_for_online() {
info("Checking if the browser is still offline...");
var request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
createInstance(Ci.nsIXMLHttpRequest);
request.open("GET", TESTROOT + "empty.xpi", true);
request.onerror = wait_for_online;
request.onload = Harness.finish;
request.send(null);
}
is(count, 0, "No add-ons should have been installed");
try {
Services.prefs.setBoolPref("browser.offline", false);
@ -35,5 +45,5 @@ function finish_test(count) {
Services.perms.remove("example.com", "install");
gBrowser.removeCurrentTab();
Harness.finish();
wait_for_online();
}