зеркало из https://github.com/mozilla/gecko-dev.git
Merge the last PGO-green inbound changeset to m-c.
This commit is contained in:
Коммит
631613136a
|
@ -6,8 +6,7 @@
|
|||
pref("startup.homepage_override_url","");
|
||||
pref("startup.homepage_welcome_url","");
|
||||
// The time interval between checks for a new version (in seconds)
|
||||
// nightly=8 hours, official=24 hours
|
||||
pref("app.update.interval", 28800);
|
||||
pref("app.update.interval", 28800); // 8 hours
|
||||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 60);
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%");
|
||||
pref("startup.homepage_welcome_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/firstrun/");
|
||||
// Interval: Time between checks for a new version (in seconds)
|
||||
// nightly=6 hours, official=24 hours
|
||||
pref("app.update.interval", 86400);
|
||||
pref("app.update.interval", 43200); // 12 hours
|
||||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 600);
|
||||
pref("app.update.download.backgroundInterval", 60);
|
||||
// Give the user x seconds to react before showing the big UI. default=24 hours
|
||||
pref("app.update.promptWaitTime", 86400);
|
||||
// URL user can browse to manually if for some reason all update installation
|
||||
|
|
|
@ -142,6 +142,32 @@ class Marionette(object):
|
|||
|
||||
self.client = MarionetteClient(self.host, self.port)
|
||||
|
||||
if emulator:
|
||||
# When launching an emulator, telephony API's are not
|
||||
# available immediately. They start working after the
|
||||
# system-message-listener-ready event is observed. See
|
||||
# bug 792647. This code causes us to wait for this event
|
||||
# after launching an emulator, before allowing any tests
|
||||
# to run.
|
||||
self.start_session()
|
||||
self.set_context(self.CONTEXT_CHROME)
|
||||
self.set_script_timeout(30000)
|
||||
try:
|
||||
self.execute_async_script("""
|
||||
waitFor(
|
||||
function() { marionetteScriptFinished(true); },
|
||||
function() { return isSystemMessageListenerReady(); }
|
||||
);
|
||||
""")
|
||||
except ScriptTimeoutException:
|
||||
# We silently ignore the timeout if it occurs, since
|
||||
# isSystemMessageListenerReady() isn't available on
|
||||
# older emulators. 30s *should* be enough of a delay
|
||||
# to allow telephony API's to work.
|
||||
pass
|
||||
self.set_context(self.CONTEXT_CONTENT)
|
||||
self.delete_session()
|
||||
|
||||
def __del__(self):
|
||||
if self.emulator:
|
||||
self.emulator.close()
|
||||
|
|
|
@ -161,16 +161,6 @@ class MarionetteJSTestCase(CommonTestCase):
|
|||
self.marionette.start_session()
|
||||
self.marionette.execute_script("log('TEST-START: %s');" % self.jsFile.replace('\\', '\\\\'))
|
||||
|
||||
self.marionette.set_context(self.marionette.CONTEXT_CHROME)
|
||||
self.marionette.set_script_timeout(30000)
|
||||
self.marionette.execute_async_script("""
|
||||
waitFor(
|
||||
function() { marionetteScriptFinished(true); },
|
||||
function() { return isSystemMessageListenerReady(); }
|
||||
);
|
||||
""")
|
||||
self.marionette.set_context(self.marionette.CONTEXT_CONTENT)
|
||||
|
||||
f = open(self.jsFile, 'r')
|
||||
js = f.read()
|
||||
args = []
|
||||
|
|
|
@ -72,6 +72,7 @@ _SERV_FILES = \
|
|||
pywebsocket_wrapper.py \
|
||||
plain-loop.html \
|
||||
android.json \
|
||||
b2g.json \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(MOZ_BUILD_APP),mobile/android)
|
||||
|
|
|
@ -1033,7 +1033,7 @@ function handleFallbackToCompleteUpdate(update, postStaging) {
|
|||
if (update.selectedPatch && oldType == "partial" && update.patchCount == 2) {
|
||||
// Partial patch application failed, try downloading the complete
|
||||
// update in the background instead.
|
||||
LOG("UpdateService:_postUpdateProcessing - install of partial patch " +
|
||||
LOG("handleFallbackToCompleteUpdate - install of partial patch " +
|
||||
"failed, downloading complete patch");
|
||||
var status = Cc["@mozilla.org/updates/update-service;1"].
|
||||
getService(Ci.nsIApplicationUpdateService).
|
||||
|
@ -1628,8 +1628,15 @@ UpdateService.prototype = {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!update)
|
||||
if (!update) {
|
||||
if (status != STATE_SUCCEEDED) {
|
||||
LOG("UpdateService:_postUpdateProcessing - previous patch failed " +
|
||||
"and no patch available");
|
||||
cleanupActiveUpdate();
|
||||
return;
|
||||
}
|
||||
update = new Update(null);
|
||||
}
|
||||
|
||||
var prompter = Cc["@mozilla.org/updates/update-prompt;1"].
|
||||
createInstance(Ci.nsIUpdatePrompt);
|
||||
|
@ -2490,13 +2497,21 @@ UpdateManager.prototype = {
|
|||
get activeUpdate() {
|
||||
if (this._activeUpdate &&
|
||||
this._activeUpdate.channel != UpdateChannel.get()) {
|
||||
// User switched channels, clear out any old active updates and remove
|
||||
// partial downloads
|
||||
this._activeUpdate = null;
|
||||
this.saveUpdates();
|
||||
LOG("UpdateManager:get activeUpdate - channel has changed, " +
|
||||
"reloading default preferences to workaround bug 802022");
|
||||
// Workaround to get distribution preferences loaded (Bug 774618). This
|
||||
// can be removed after bug 802022 is fixed.
|
||||
let prefSvc = Services.prefs.QueryInterface(Ci.nsIObserver);
|
||||
prefSvc.observe(null, "reload-default-prefs", null);
|
||||
if (this._activeUpdate.channel != UpdateChannel.get()) {
|
||||
// User switched channels, clear out any old active updates and remove
|
||||
// partial downloads
|
||||
this._activeUpdate = null;
|
||||
this.saveUpdates();
|
||||
|
||||
// Destroy the updates directory, since we're done with it.
|
||||
cleanUpUpdatesDir();
|
||||
// Destroy the updates directory, since we're done with it.
|
||||
cleanUpUpdatesDir();
|
||||
}
|
||||
}
|
||||
return this._activeUpdate;
|
||||
},
|
||||
|
|
|
@ -167,7 +167,6 @@ var gCloseWindowTimeoutCounter = 0;
|
|||
|
||||
// The following vars are for restoring previous preference values (if present)
|
||||
// when the test finishes.
|
||||
var gAppUpdateChannel; // app.update.channel (default prefbranch)
|
||||
var gAppUpdateEnabled; // app.update.enabled
|
||||
var gAppUpdateURLDefault; // app.update.url (default prefbranch)
|
||||
var gAppUpdateURL; // app.update.url.override
|
||||
|
@ -310,6 +309,12 @@ function finishTestDefault() {
|
|||
gTimeoutTimer = null;
|
||||
}
|
||||
|
||||
if (gChannel) {
|
||||
debugDump("channel = " + gChannel);
|
||||
gChannel = null;
|
||||
gPrefRoot.removeObserver(PREF_APP_UPDATE_CHANNEL, observer);
|
||||
}
|
||||
|
||||
verifyTestsRan();
|
||||
|
||||
resetPrefs();
|
||||
|
@ -791,9 +796,6 @@ function verifyTestsRan() {
|
|||
* set back to the original values when each test has finished.
|
||||
*/
|
||||
function setupPrefs() {
|
||||
gAppUpdateChannel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
|
||||
setUpdateChannel();
|
||||
|
||||
if (DEBUG_AUS_TEST) {
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true)
|
||||
}
|
||||
|
@ -836,10 +838,6 @@ function resetPrefs() {
|
|||
gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, gAppUpdateURLDefault);
|
||||
}
|
||||
|
||||
if (gAppUpdateChannel !== undefined) {
|
||||
setUpdateChannel(gAppUpdateChannel);
|
||||
}
|
||||
|
||||
if (gAppUpdateEnabled !== undefined) {
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, gAppUpdateEnabled);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ const PERMS_DIRECTORY = 0755;
|
|||
|
||||
const DEFAULT_UPDATE_VERSION = "999999.0";
|
||||
|
||||
var gChannel;
|
||||
|
||||
#include sharedUpdateXML.js
|
||||
|
||||
AUS_Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -113,6 +115,10 @@ XPCOMUtils.defineLazyGetter(this, "gDefaultPrefBranch", function test_gDPB() {
|
|||
return Services.prefs.getDefaultBranch(null);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gPrefRoot", function test_gPR() {
|
||||
return Services.prefs.getBranch(null);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gZipW", function test_gZipW() {
|
||||
return AUS_Cc["@mozilla.org/zipwriter;1"].
|
||||
createInstance(AUS_Ci.nsIZipWriter);
|
||||
|
@ -134,14 +140,28 @@ function reloadUpdateManagerData() {
|
|||
* Sets the app.update.channel preference.
|
||||
*
|
||||
* @param aChannel
|
||||
* The update channel. If not specified 'test_channel' will be used.
|
||||
* The update channel.
|
||||
*/
|
||||
function setUpdateChannel(aChannel) {
|
||||
let channel = aChannel ? aChannel : "test_channel";
|
||||
debugDump("setting default pref " + PREF_APP_UPDATE_CHANNEL + " to " + channel);
|
||||
gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, channel);
|
||||
gChannel = aChannel;
|
||||
debugDump("setting default pref " + PREF_APP_UPDATE_CHANNEL + " to " + gChannel);
|
||||
gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, gChannel);
|
||||
gPrefRoot.addObserver(PREF_APP_UPDATE_CHANNEL, observer, false);
|
||||
}
|
||||
|
||||
var observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "nsPref:changed" && aData == PREF_APP_UPDATE_CHANNEL) {
|
||||
var channel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
|
||||
if (channel != gChannel) {
|
||||
debugDump("Changing channel from " + channel + " to " + gChannel);
|
||||
gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, gChannel);
|
||||
}
|
||||
}
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([AUS_Ci.nsIObserver])
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the app.update.url.override preference.
|
||||
*
|
||||
|
|
|
@ -115,7 +115,8 @@ function getLocalUpdatesXMLString(aUpdates) {
|
|||
* If not specified it will default to 'true'.
|
||||
* @param aChannel (optional)
|
||||
* The update channel name.
|
||||
* If not specified it will default to 'test_channel'.
|
||||
* If not specified it will default to the default preference value of
|
||||
* app.update.channel.
|
||||
* @param aForegroundDownload (optional)
|
||||
* The string 'true' if this update was manually downloaded or the
|
||||
* string 'false' if this update was automatically downloaded.
|
||||
|
@ -138,7 +139,8 @@ function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion,
|
|||
let statusText = aStatusText ? aStatusText : "Install Pending";
|
||||
let isCompleteUpdate =
|
||||
typeof(aIsCompleteUpdate) == "string" ? aIsCompleteUpdate : "true";
|
||||
let channel = aChannel ? aChannel : "test_channel";
|
||||
let channel = aChannel ? aChannel
|
||||
: gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
|
||||
let foregroundDownload =
|
||||
typeof(aForegroundDownload) == "string" ? aForegroundDownload : "true";
|
||||
let previousAppVersion = aPreviousAppVersion ? "previousAppVersion=\"" +
|
||||
|
|
|
@ -307,6 +307,10 @@ function cleanUp() {
|
|||
// writing the old data to the files that have just been removed.
|
||||
reloadUpdateManagerData();
|
||||
|
||||
if (gChannel) {
|
||||
gPrefRoot.removeObserver(PREF_APP_UPDATE_CHANNEL, observer);
|
||||
}
|
||||
|
||||
// Call app update's observe method passing xpcom-shutdown to test that the
|
||||
// shutdown of app update runs without throwing or leaking. The observer
|
||||
// method is used directly instead of calling notifyObservers so components
|
||||
|
|
|
@ -13,7 +13,7 @@ function run_test() {
|
|||
do_register_cleanup(end_test);
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateURLOverride();
|
||||
setUpdateChannel();
|
||||
setUpdateChannel("test_channel");
|
||||
// The mock XMLHttpRequest is MUCH faster
|
||||
overrideXHR(callHandleEvent);
|
||||
standardInit();
|
||||
|
|
|
@ -149,7 +149,7 @@ function run_test_pt6() {
|
|||
var url = URL_PREFIX + "%CHANNEL%/";
|
||||
logTestInfo("testing url constructed with %CHANNEL% - " + url);
|
||||
setUpdateURLOverride(url);
|
||||
setUpdateChannel();
|
||||
setUpdateChannel("test_channel");
|
||||
gUpdateChecker.checkForUpdates(updateCheckListener, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ function run_test() {
|
|||
logTestInfo("testing removal of an update download in progress for an " +
|
||||
"older version of the application on startup (bug 485624)");
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
var patches, updates;
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ function run_test() {
|
|||
logTestInfo("testing resuming an update download in progress for the same " +
|
||||
"version of the application on startup (bug 485624)");
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
var patches, updates;
|
||||
|
||||
|
|
|
@ -12,9 +12,8 @@ function run_test() {
|
|||
logTestInfo("testing removing an active update for a channel that is not" +
|
||||
"valid due to switching channels (bug 486275)");
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel("original_channel");
|
||||
|
||||
var patches, update, update;
|
||||
var patches, updates, update;
|
||||
|
||||
patches = getLocalPatchString(null, null, null, null, null, null,
|
||||
STATE_DOWNLOADING);
|
||||
|
@ -29,6 +28,8 @@ function run_test() {
|
|||
getString("patchApplyFailure"));
|
||||
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
|
||||
|
||||
setUpdateChannel("original_channel");
|
||||
|
||||
standardInit();
|
||||
|
||||
do_check_eq(gUpdateManager.updateCount, 1);
|
||||
|
|
|
@ -13,7 +13,6 @@ function run_test() {
|
|||
"same version of the application with the same application " +
|
||||
"build id on startup (bug 536547)");
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
var patches, updates;
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ function run_test() {
|
|||
do_register_cleanup(end_test);
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
|
||||
var patches = getLocalPatchString(null, null, null, null, null, null,
|
||||
|
|
|
@ -10,7 +10,6 @@ function run_test() {
|
|||
do_register_cleanup(end_test);
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
|
||||
var patches = getLocalPatchString(null, null, null, null, null, null,
|
||||
|
|
|
@ -9,7 +9,6 @@ function run_test() {
|
|||
do_register_cleanup(end_test);
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
|
||||
var patches = getLocalPatchString(null, null, null, null, null, null,
|
||||
|
|
|
@ -9,7 +9,6 @@ function run_test() {
|
|||
do_register_cleanup(end_test);
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
|
||||
var patches = getLocalPatchString(null, null, null, null, null, null,
|
||||
|
|
|
@ -16,7 +16,6 @@ function run_test() {
|
|||
"when the " + PREF_APP_UPDATE_SILENT + " preference is true");
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ function run_test() {
|
|||
"there is already an application update window open");
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ function run_test() {
|
|||
"browser.privatebrowsing.autostart set to true");
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
|
||||
|
|
|
@ -17,7 +17,6 @@ function run_test() {
|
|||
" and the update.errorCode = " + WRITE_ERROR);
|
||||
|
||||
removeUpdateDirsAndFiles();
|
||||
setUpdateChannel();
|
||||
|
||||
let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче