зеркало из https://github.com/mozilla/gecko-dev.git
Bug 474763: Enable xpinstall test suite and fix switching on/offline. r=bsmedberg
This commit is contained in:
Родитель
cccd4ed473
Коммит
b6be0c7ba8
|
@ -50,8 +50,8 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = xpinstall
|
||||
DIRS = public src
|
||||
|
||||
#ifdef ENABLE_TESTS
|
||||
#DIRS += tests
|
||||
#endif
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -80,6 +80,8 @@ _BROWSER_FILES = harness.js \
|
|||
browser_offline.js \
|
||||
browser_chrome.js \
|
||||
browser_cancel.js \
|
||||
browser_navigateaway.js \
|
||||
browser_navigateaway2.js \
|
||||
unsigned.xpi \
|
||||
signed.xpi \
|
||||
signed2.xpi \
|
||||
|
|
|
@ -23,7 +23,17 @@ function test() {
|
|||
}
|
||||
|
||||
function download_progress(addon, value, maxValue) {
|
||||
BrowserOffline.toggleOfflineStatus();
|
||||
var prefs = Components.classes["@mozilla.org/preferences;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService2);
|
||||
|
||||
try {
|
||||
ioService.manageOfflineStatus = false;
|
||||
prefs.setBoolPref("browser.offline", true);
|
||||
ioService.offline = true;
|
||||
} catch (ex) {
|
||||
}
|
||||
}
|
||||
|
||||
function check_xpi_install(addon, status) {
|
||||
|
@ -31,7 +41,15 @@ function check_xpi_install(addon, status) {
|
|||
}
|
||||
|
||||
function finish_test() {
|
||||
BrowserOffline.toggleOfflineStatus();
|
||||
var prefs = Components.classes["@mozilla.org/preferences;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService2);
|
||||
try {
|
||||
prefs.setBoolPref("browser.offline", false);
|
||||
ioService.offline = false;
|
||||
} catch (ex) {
|
||||
}
|
||||
|
||||
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager);
|
||||
|
|
Загрузка…
Ссылка в новой задаче