additional test code cleanup - Bug 1314476 - Fix numerous app update eslint errors. r=mhowell

This commit is contained in:
Robert Strong 2016-11-02 13:02:05 -07:00
Родитель e79eae17bc
Коммит f0a313b11b
8 изменённых файлов: 18 добавлений и 18 удалений

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

@ -562,7 +562,7 @@ function getExpectedButtonStates() {
if (gTest.neverButton) {
return {extra1: {disabled: false, hidden: false},
extra2: {disabled: false, hidden: false},
next: {disabled: false, hidden: false}}
next: {disabled: false, hidden: false}};
}
return {extra1: {disabled: false, hidden: false},
next: {disabled: false, hidden: false}};

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

@ -61,7 +61,7 @@ const FILE_UPDATE_TEST = "update.test";
const FILE_UPDATE_VERSION = "update.version";
const UPDATE_SETTINGS_CONTENTS = "[Settings]\n" +
"ACCEPTED_MAR_CHANNEL_IDS=xpcshell-test\n"
"ACCEPTED_MAR_CHANNEL_IDS=xpcshell-test\n";
const PR_RDWR = 0x04;
const PR_CREATE_FILE = 0x08;

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

@ -117,7 +117,7 @@ function getRemotePatchString(aType, aURL, aHashFunction, aHashValue, aSize) {
*/
function getLocalUpdatesXMLString(aUpdates) {
if (!aUpdates || aUpdates == "") {
return "<updates xmlns=\"http://www.mozilla.org/2005/app-update\"/>"
return "<updates xmlns=\"http://www.mozilla.org/2005/app-update\"/>";
}
return ("<updates xmlns=\"http://www.mozilla.org/2005/app-update\">" +
aUpdates +
@ -161,11 +161,11 @@ function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion,
let installDate = aInstallDate ? aInstallDate : "1238441400314";
let statusText = aStatusText ? aStatusText : "Install Pending";
let isCompleteUpdate =
typeof(aIsCompleteUpdate) == "string" ? aIsCompleteUpdate : "true";
typeof aIsCompleteUpdate == "string" ? aIsCompleteUpdate : "true";
let channel = aChannel ? aChannel
: gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
let foregroundDownload =
typeof(aForegroundDownload) == "string" ? aForegroundDownload : "true";
typeof aForegroundDownload == "string" ? aForegroundDownload : "true";
let previousAppVersion = aPreviousAppVersion ? "previousAppVersion=\"" +
aPreviousAppVersion + "\" "
: "";
@ -199,7 +199,7 @@ function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion,
*/
function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize,
aSelected, aState) {
let selected = typeof(aSelected) == "string" ? aSelected : "true";
let selected = typeof aSelected == "string" ? aSelected : "true";
let state = aState ? aState : STATE_SUCCEEDED;
return getPatchString(aType, aURL, aHashFunction, aHashValue, aSize) + " " +
"selected=\"" + selected + "\" " +

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

@ -1745,9 +1745,9 @@ function runUpdateUsingUpdater(aExpectedStatus, aSwitchApp, aExpectedExitValue)
let asan_options = null;
if (gEnv.exists("ASAN_OPTIONS")) {
asan_options = gEnv.get("ASAN_OPTIONS");
gEnv.set("ASAN_OPTIONS", asan_options + ":detect_leaks=0")
gEnv.set("ASAN_OPTIONS", asan_options + ":detect_leaks=0");
} else {
gEnv.set("ASAN_OPTIONS", "detect_leaks=0")
gEnv.set("ASAN_OPTIONS", "detect_leaks=0");
}
let process = Cc["@mozilla.org/process/util;1"].
@ -3644,7 +3644,7 @@ function UpdatePrompt(aCallback) {
callback.apply(this._callback,
Array.prototype.slice.call(arguments));
}
};
});
}
@ -3967,7 +3967,7 @@ function adjustGeneralPaths() {
}
// Call end_test first before the directory provider is unregistered
if (typeof(end_test) == typeof(Function)) {
if (typeof end_test == typeof Function) {
debugDump("calling end_test");
end_test();
}

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
const KEY_UPDATE_ARCHIVE_DIR = "UpdArchD"
const KEY_UPDATE_ARCHIVE_DIR = "UpdArchD";
var gActiveUpdate;
var gDirService;

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

@ -109,7 +109,7 @@ IncrementalDownload.prototype = {
this._observer.onStartRequest(this, this._ctxt);
let mar = getTestDirFile(FILE_SIMPLE_MAR);
mar.copyTo(this._destination.parent, this._destination.leafName);
let status = Cr.NS_OK
let status = Cr.NS_OK;
switch (gIncrementalDownloadErrorType++) {
case 0:
status = Cr.NS_ERROR_NET_RESET;

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

@ -153,7 +153,7 @@ function check_test_pt02() {
// is confusing if it returns null which is an invalid value since the test
// failure output will show a failure for null == null. To lessen the
// confusion first check that the typeof for patch.state is string.
Assert.equal(typeof(patch.state), "string",
Assert.equal(typeof patch.state, "string",
"the update patch state typeof value should equal |string|");
Assert.equal(patch.state, STATE_NONE,
"the update patch state attribute" + MSG_SHOULD_EQUAL);

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

@ -68,7 +68,7 @@ function check_test_pt1() {
gAppInfo.appBuildID + "/" + gAppInfo.OS + "_" + getABI() + "/" +
INSTALL_LOCALE + "/test_channel/" + gAppInfo.platformVersion + "/" +
getOSVersion() + "/" + getSystemCapabilities() +
"/test_distro/test_distro_version/updates.xml?force=1"
"/test_distro/test_distro_version/updates.xml?force=1";
// Log the urls since Assert.equal won't print the entire urls to the log.
if (gRequestURL != url) {
logTestInfo("expected url: " + url);
@ -161,7 +161,7 @@ function getOSVersion() {
}
osVersion = encodeURIComponent(osVersion);
}
return osVersion
return osVersion;
}
function getServicePack() {
@ -301,5 +301,5 @@ function getSystemCapabilities() {
return instructionSet;
}
return "NA"
return "NA";
}