зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G --HG-- extra : rebase_source : 5992bdde34bcc2421350433bc8c1e498a6bba848
This commit is contained in:
Родитель
60823446ea
Коммит
22dfa54ef4
|
@ -18,7 +18,7 @@ module.exports = {
|
||||||
"curly": ["error", "multi-line"],
|
"curly": ["error", "multi-line"],
|
||||||
"default-case": "off",
|
"default-case": "off",
|
||||||
"dot-location": ["error", "property"],
|
"dot-location": ["error", "property"],
|
||||||
"dot-notation": "error",
|
|
||||||
"eqeqeq": "off",
|
"eqeqeq": "off",
|
||||||
"func-names": "off",
|
"func-names": "off",
|
||||||
"func-style": "off",
|
"func-style": "off",
|
||||||
|
@ -87,7 +87,6 @@ module.exports = {
|
||||||
"wrap-iife": "off",
|
"wrap-iife": "off",
|
||||||
"wrap-regex": "off",
|
"wrap-regex": "off",
|
||||||
"yoda": "error",
|
"yoda": "error",
|
||||||
|
|
||||||
"guard-for-in": "off",
|
"guard-for-in": "off",
|
||||||
"newline-after-var": "off",
|
"newline-after-var": "off",
|
||||||
"no-alert": "off",
|
"no-alert": "off",
|
||||||
|
|
|
@ -446,8 +446,8 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags)
|
||||||
case "extraStates":
|
case "extraStates":
|
||||||
case "absentStates":
|
case "absentStates":
|
||||||
case "absentExtraStates": {
|
case "absentExtraStates": {
|
||||||
testStates(acc, accTree["states"], accTree["extraStates"],
|
testStates(acc, accTree.states, accTree.extraStates,
|
||||||
accTree["absentStates"], accTree["absentExtraStates"]);
|
accTree.absentStates, accTree.absentExtraStates);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test children.
|
// Test children.
|
||||||
if ("children" in accTree && accTree["children"] instanceof Array) {
|
if ("children" in accTree && accTree.children instanceof Array) {
|
||||||
var children = acc.children;
|
var children = acc.children;
|
||||||
var childCount = children.length;
|
var childCount = children.length;
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
// area7
|
// area7
|
||||||
ID = "area7";
|
ID = "area7";
|
||||||
defAttrs = buildDefaultTextAttrs(ID, "12pt");
|
defAttrs = buildDefaultTextAttrs(ID, "12pt");
|
||||||
defAttrs["language"] = "en";
|
defAttrs.language = "en";
|
||||||
testDefaultTextAttrs(ID, defAttrs);
|
testDefaultTextAttrs(ID, defAttrs);
|
||||||
|
|
||||||
attrs = {"language": "ru"};
|
attrs = {"language": "ru"};
|
||||||
|
|
|
@ -467,7 +467,7 @@
|
||||||
for (var role of aRoleList) {
|
for (var role of aRoleList) {
|
||||||
var ch = {};
|
var ch = {};
|
||||||
ch[role] = [];
|
ch[role] = [];
|
||||||
tree["SECTION"].push(ch);
|
tree.SECTION.push(ch);
|
||||||
}
|
}
|
||||||
testAccessibleTree(aContainer, tree);
|
testAccessibleTree(aContainer, tree);
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,12 +142,12 @@ var gGestureSupport = {
|
||||||
offset += updateEvent.delta;
|
offset += updateEvent.delta;
|
||||||
|
|
||||||
// Check if the cumulative deltas exceed the threshold
|
// Check if the cumulative deltas exceed the threshold
|
||||||
if (Math.abs(offset) > aPref["threshold"]) {
|
if (Math.abs(offset) > aPref.threshold) {
|
||||||
// Trigger the action if we don't care about latching; otherwise, make
|
// Trigger the action if we don't care about latching; otherwise, make
|
||||||
// sure either we're not latched and going the same direction of the
|
// sure either we're not latched and going the same direction of the
|
||||||
// initial motion; or we're latched and going the opposite way
|
// initial motion; or we're latched and going the opposite way
|
||||||
let sameDir = (latchDir ^ offset) >= 0;
|
let sameDir = (latchDir ^ offset) >= 0;
|
||||||
if (!aPref["latched"] || (isLatched ^ sameDir)) {
|
if (!aPref.latched || (isLatched ^ sameDir)) {
|
||||||
this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
||||||
|
|
||||||
// We must be getting latched or leaving it, so just toggle
|
// We must be getting latched or leaving it, so just toggle
|
||||||
|
|
|
@ -12,16 +12,16 @@ const fm = Services.focus;
|
||||||
|
|
||||||
function EventStore() {
|
function EventStore() {
|
||||||
this["main-window"] = [];
|
this["main-window"] = [];
|
||||||
this["window1"] = [];
|
this.window1 = [];
|
||||||
this["window2"] = [];
|
this.window2 = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
EventStore.prototype = {
|
EventStore.prototype = {
|
||||||
"push": function(event) {
|
"push": function(event) {
|
||||||
if (event.indexOf("1") > -1) {
|
if (event.indexOf("1") > -1) {
|
||||||
this["window1"].push(event);
|
this.window1.push(event);
|
||||||
} else if (event.indexOf("2") > -1) {
|
} else if (event.indexOf("2") > -1) {
|
||||||
this["window2"].push(event);
|
this.window2.push(event);
|
||||||
} else {
|
} else {
|
||||||
this["main-window"].push(event);
|
this["main-window"].push(event);
|
||||||
}
|
}
|
||||||
|
@ -543,7 +543,7 @@ function expectFocusShift(callback, expectedWindow, expectedElement, focusChange
|
||||||
callback();
|
callback();
|
||||||
|
|
||||||
// No events are expected, so resolve the promise immediately.
|
// No events are expected, so resolve the promise immediately.
|
||||||
if (expectedEvents["main-window"].length + expectedEvents["window1"].length + expectedEvents["window2"].length == 0) {
|
if (expectedEvents["main-window"].length + expectedEvents.window1.length + expectedEvents.window2.length == 0) {
|
||||||
currentPromiseResolver();
|
currentPromiseResolver();
|
||||||
currentPromiseResolver = null;
|
currentPromiseResolver = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -732,13 +732,13 @@ function openPreferences(paneID, extraArgs) {
|
||||||
histogram.add("other");
|
histogram.add("other");
|
||||||
}
|
}
|
||||||
function switchToAdvancedSubPane(doc) {
|
function switchToAdvancedSubPane(doc) {
|
||||||
if (extraArgs && extraArgs["advancedTab"]) {
|
if (extraArgs && extraArgs.advancedTab) {
|
||||||
// After the Preferences reorg works in Bug 1335907, no more advancedPrefs element.
|
// After the Preferences reorg works in Bug 1335907, no more advancedPrefs element.
|
||||||
// The old Preference is pref-off behind `browser.preferences.useOldOrganization` on Nightly.
|
// The old Preference is pref-off behind `browser.preferences.useOldOrganization` on Nightly.
|
||||||
// During the transition between the old and new Preferences, should do checking before proceeding.
|
// During the transition between the old and new Preferences, should do checking before proceeding.
|
||||||
let advancedPaneTabs = doc.getElementById("advancedPrefs");
|
let advancedPaneTabs = doc.getElementById("advancedPrefs");
|
||||||
if (advancedPaneTabs) {
|
if (advancedPaneTabs) {
|
||||||
advancedPaneTabs.selectedTab = doc.getElementById(extraArgs["advancedTab"]);
|
advancedPaneTabs.selectedTab = doc.getElementById(extraArgs.advancedTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -751,9 +751,9 @@ function openPreferences(paneID, extraArgs) {
|
||||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||||
let friendlyCategoryName = internalPrefCategoryNameToFriendlyName(paneID);
|
let friendlyCategoryName = internalPrefCategoryNameToFriendlyName(paneID);
|
||||||
let params;
|
let params;
|
||||||
if (extraArgs && extraArgs["urlParams"]) {
|
if (extraArgs && extraArgs.urlParams) {
|
||||||
params = new URLSearchParams();
|
params = new URLSearchParams();
|
||||||
let urlParams = extraArgs["urlParams"];
|
let urlParams = extraArgs.urlParams;
|
||||||
for (let name in urlParams) {
|
for (let name in urlParams) {
|
||||||
if (urlParams[name] !== undefined) {
|
if (urlParams[name] !== undefined) {
|
||||||
params.set(name, urlParams[name]);
|
params.set(name, urlParams[name]);
|
||||||
|
|
|
@ -66,8 +66,8 @@ add_task(async function test_cookie_getCookiesWithOriginAttributes() {
|
||||||
ok(enumerator.hasMoreElements(), "Cookies available");
|
ok(enumerator.hasMoreElements(), "Cookies available");
|
||||||
|
|
||||||
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
||||||
is(foundCookie["name"], cookieName, "Check cookie name");
|
is(foundCookie.name, cookieName, "Check cookie name");
|
||||||
is(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
|
is(foundCookie.value, USER_CONTEXTS[userContextId], "Check cookie value");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
||||||
|
|
|
@ -145,8 +145,8 @@ async function test_cookie_cleared() {
|
||||||
ok(enumerator.hasMoreElements(), "Cookies available");
|
ok(enumerator.hasMoreElements(), "Cookies available");
|
||||||
|
|
||||||
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
||||||
Assert.equal(foundCookie["name"], COOKIE_NAME, "Check cookie name");
|
Assert.equal(foundCookie.name, COOKIE_NAME, "Check cookie name");
|
||||||
Assert.equal(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
|
Assert.equal(foundCookie.value, USER_CONTEXTS[userContextId], "Check cookie value");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forget the site.
|
// Forget the site.
|
||||||
|
|
|
@ -57,8 +57,8 @@ function checkCookies(ignoreContext = null) {
|
||||||
ok(enumerator.hasMoreElements(), "Cookies available");
|
ok(enumerator.hasMoreElements(), "Cookies available");
|
||||||
|
|
||||||
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
||||||
is(foundCookie["name"], COOKIE_NAME, "Check cookie name");
|
is(foundCookie.name, COOKIE_NAME, "Check cookie name");
|
||||||
is(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
|
is(foundCookie.value, USER_CONTEXTS[userContextId], "Check cookie value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +95,8 @@ add_task(async function test_cookie_getCookiesWithOriginAttributes() {
|
||||||
ok(enumerator.hasMoreElements(), "Cookies available");
|
ok(enumerator.hasMoreElements(), "Cookies available");
|
||||||
|
|
||||||
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
|
||||||
is(foundCookie["name"], COOKIE_NAME, "Check cookie name");
|
is(foundCookie.name, COOKIE_NAME, "Check cookie name");
|
||||||
is(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
|
is(foundCookie.value, USER_CONTEXTS[userContextId], "Check cookie value");
|
||||||
}
|
}
|
||||||
checkCookies();
|
checkCookies();
|
||||||
|
|
||||||
|
|
|
@ -555,7 +555,7 @@ var CustomizableUIInternal = {
|
||||||
if (props.get("type") == CustomizableUI.TYPE_TOOLBAR) {
|
if (props.get("type") == CustomizableUI.TYPE_TOOLBAR) {
|
||||||
// Check aProperties instead of props because this check is only interested
|
// Check aProperties instead of props because this check is only interested
|
||||||
// in the passed arguments, not the state of a potentially pre-existing area.
|
// in the passed arguments, not the state of a potentially pre-existing area.
|
||||||
if (!aInternalCaller && aProperties["defaultCollapsed"]) {
|
if (!aInternalCaller && aProperties.defaultCollapsed) {
|
||||||
throw new Error("defaultCollapsed is only allowed for default toolbars.")
|
throw new Error("defaultCollapsed is only allowed for default toolbars.")
|
||||||
}
|
}
|
||||||
if (!props.has("defaultCollapsed")) {
|
if (!props.has("defaultCollapsed")) {
|
||||||
|
|
|
@ -2552,7 +2552,7 @@ function __dumpDragData(aEvent, caller) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let str = "Dumping drag data (" + (caller ? caller + " in " : "") + "CustomizeMode.jsm) {\n";
|
let str = "Dumping drag data (" + (caller ? caller + " in " : "") + "CustomizeMode.jsm) {\n";
|
||||||
str += " type: " + aEvent["type"] + "\n";
|
str += " type: " + aEvent.type + "\n";
|
||||||
for (let el of ["target", "currentTarget", "relatedTarget"]) {
|
for (let el of ["target", "currentTarget", "relatedTarget"]) {
|
||||||
if (aEvent[el]) {
|
if (aEvent[el]) {
|
||||||
str += " " + el + ": " + aEvent[el] + "(localName=" + aEvent[el].localName + "; id=" + aEvent[el].id + ")\n";
|
str += " " + el + ": " + aEvent[el] + "(localName=" + aEvent[el].localName + "; id=" + aEvent[el].id + ")\n";
|
||||||
|
|
|
@ -117,7 +117,7 @@ DistributionCustomizer.prototype = {
|
||||||
items[itemIndex] = {};
|
items[itemIndex] = {};
|
||||||
items[itemIndex][iprop] = this._ini.getString(section, key);
|
items[itemIndex][iprop] = this._ini.getString(section, key);
|
||||||
|
|
||||||
if (iprop == "type" && items[itemIndex]["type"] == "default")
|
if (iprop == "type" && items[itemIndex].type == "default")
|
||||||
defaultIndex = itemIndex;
|
defaultIndex = itemIndex;
|
||||||
|
|
||||||
if (maxIndex < itemIndex)
|
if (maxIndex < itemIndex)
|
||||||
|
@ -264,11 +264,11 @@ DistributionCustomizer.prototype = {
|
||||||
|
|
||||||
// The global section, and several of its fields, is required
|
// The global section, and several of its fields, is required
|
||||||
// (we also check here to be consistent with applyPrefDefaults below)
|
// (we also check here to be consistent with applyPrefDefaults below)
|
||||||
if (!sections["Global"])
|
if (!sections.Global)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
|
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
|
||||||
if (!(globalPrefs["id"] && globalPrefs["version"] && globalPrefs["about"]))
|
if (!(globalPrefs.id && globalPrefs.version && globalPrefs.about))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let bmProcessedPref;
|
let bmProcessedPref;
|
||||||
|
@ -283,10 +283,10 @@ DistributionCustomizer.prototype = {
|
||||||
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
|
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
|
||||||
|
|
||||||
if (!bmProcessed) {
|
if (!bmProcessed) {
|
||||||
if (sections["BookmarksMenu"])
|
if (sections.BookmarksMenu)
|
||||||
await this._parseBookmarksSection(PlacesUtils.bookmarks.menuGuid,
|
await this._parseBookmarksSection(PlacesUtils.bookmarks.menuGuid,
|
||||||
"BookmarksMenu");
|
"BookmarksMenu");
|
||||||
if (sections["BookmarksToolbar"])
|
if (sections.BookmarksToolbar)
|
||||||
await this._parseBookmarksSection(PlacesUtils.bookmarks.toolbarGuid,
|
await this._parseBookmarksSection(PlacesUtils.bookmarks.toolbarGuid,
|
||||||
"BookmarksToolbar");
|
"BookmarksToolbar");
|
||||||
this._prefs.setBoolPref(bmProcessedPref, true);
|
this._prefs.setBoolPref(bmProcessedPref, true);
|
||||||
|
@ -302,10 +302,10 @@ DistributionCustomizer.prototype = {
|
||||||
let sections = enumToObject(this._ini.getSections());
|
let sections = enumToObject(this._ini.getSections());
|
||||||
|
|
||||||
// The global section, and several of its fields, is required
|
// The global section, and several of its fields, is required
|
||||||
if (!sections["Global"])
|
if (!sections.Global)
|
||||||
return this._checkCustomizationComplete();
|
return this._checkCustomizationComplete();
|
||||||
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
|
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
|
||||||
if (!(globalPrefs["id"] && globalPrefs["version"] && globalPrefs["about"]))
|
if (!(globalPrefs.id && globalPrefs.version && globalPrefs.about))
|
||||||
return this._checkCustomizationComplete();
|
return this._checkCustomizationComplete();
|
||||||
|
|
||||||
let defaults = new Preferences({defaultBranch: true});
|
let defaults = new Preferences({defaultBranch: true});
|
||||||
|
@ -360,7 +360,7 @@ DistributionCustomizer.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sections["Preferences"]) {
|
if (sections.Preferences) {
|
||||||
for (let key of enumerate(this._ini.getKeys("Preferences"))) {
|
for (let key of enumerate(this._ini.getKeys("Preferences"))) {
|
||||||
if (usedPreferences.indexOf(key) > -1) {
|
if (usedPreferences.indexOf(key) > -1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -412,7 +412,7 @@ DistributionCustomizer.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sections["LocalizablePreferences"]) {
|
if (sections.LocalizablePreferences) {
|
||||||
for (let key of enumerate(this._ini.getKeys("LocalizablePreferences"))) {
|
for (let key of enumerate(this._ini.getKeys("LocalizablePreferences"))) {
|
||||||
if (usedLocalizablePreferences.indexOf(key) > -1) {
|
if (usedLocalizablePreferences.indexOf(key) > -1) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -5,7 +5,6 @@ module.exports = {
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
"comma-dangle": "off",
|
"comma-dangle": "off",
|
||||||
"complexity": ["error", {"max": 21}],
|
"complexity": ["error", {"max": 21}],
|
||||||
"dot-notation": "error",
|
|
||||||
"indent": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
|
"indent": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
|
||||||
"max-nested-callbacks": ["error", 3],
|
"max-nested-callbacks": ["error", 3],
|
||||||
"new-parens": "error",
|
"new-parens": "error",
|
||||||
|
|
|
@ -1899,7 +1899,7 @@ BrowserGlue.prototype = {
|
||||||
|
|
||||||
// Typed behavior will be used only for results from history.
|
// Typed behavior will be used only for results from history.
|
||||||
if (defaultBehavior != -1 &&
|
if (defaultBehavior != -1 &&
|
||||||
!!(defaultBehavior & Ci.mozIPlacesAutoComplete["BEHAVIOR_TYPED"])) {
|
!!(defaultBehavior & Ci.mozIPlacesAutoComplete.BEHAVIOR_TYPED)) {
|
||||||
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
|
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let openerFrame = window.opener.frames["child"];
|
let openerFrame = window.opener.frames.child;
|
||||||
let result = openerFrame.document.cookie === cookieValue;
|
let result = openerFrame.document.cookie === cookieValue;
|
||||||
if (result && !openerRestriction) {
|
if (result && !openerRestriction) {
|
||||||
document.title = "pass";
|
document.title = "pass";
|
||||||
|
|
|
@ -1360,7 +1360,7 @@ this.PlacesUIUtils = {
|
||||||
// ensure the left-pane root is initialized;
|
// ensure the left-pane root is initialized;
|
||||||
this.leftPaneFolderId;
|
this.leftPaneFolderId;
|
||||||
delete this.allBookmarksFolderId;
|
delete this.allBookmarksFolderId;
|
||||||
return this.allBookmarksFolderId = this.leftPaneQueries["AllBookmarks"];
|
return this.allBookmarksFolderId = this.leftPaneQueries.AllBookmarks;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -427,37 +427,37 @@ PlacesController.prototype = {
|
||||||
// property way too often
|
// property way too often
|
||||||
switch (nodeType) {
|
switch (nodeType) {
|
||||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY:
|
case Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY:
|
||||||
nodeData["query"] = true;
|
nodeData.query = true;
|
||||||
if (node.parent) {
|
if (node.parent) {
|
||||||
switch (PlacesUtils.asQuery(node.parent).queryOptions.resultType) {
|
switch (PlacesUtils.asQuery(node.parent).queryOptions.resultType) {
|
||||||
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY:
|
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY:
|
||||||
nodeData["host"] = true;
|
nodeData.host = true;
|
||||||
break;
|
break;
|
||||||
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY:
|
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY:
|
||||||
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY:
|
case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY:
|
||||||
nodeData["day"] = true;
|
nodeData.day = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
|
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
|
||||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT:
|
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT:
|
||||||
nodeData["folder"] = true;
|
nodeData.folder = true;
|
||||||
break;
|
break;
|
||||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR:
|
case Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR:
|
||||||
nodeData["separator"] = true;
|
nodeData.separator = true;
|
||||||
break;
|
break;
|
||||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_URI:
|
case Ci.nsINavHistoryResultNode.RESULT_TYPE_URI:
|
||||||
nodeData["link"] = true;
|
nodeData.link = true;
|
||||||
uri = NetUtil.newURI(node.uri);
|
uri = NetUtil.newURI(node.uri);
|
||||||
if (PlacesUtils.nodeIsBookmark(node)) {
|
if (PlacesUtils.nodeIsBookmark(node)) {
|
||||||
nodeData["bookmark"] = true;
|
nodeData.bookmark = true;
|
||||||
var parentNode = node.parent;
|
var parentNode = node.parent;
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
if (PlacesUtils.nodeIsTagQuery(parentNode))
|
if (PlacesUtils.nodeIsTagQuery(parentNode))
|
||||||
nodeData["tagChild"] = true;
|
nodeData.tagChild = true;
|
||||||
else if (this.hasCachedLivemarkInfo(parentNode))
|
else if (this.hasCachedLivemarkInfo(parentNode))
|
||||||
nodeData["livemarkChild"] = true;
|
nodeData.livemarkChild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -283,9 +283,9 @@ var PlacesOrganizer = {
|
||||||
let itemId = aNode.itemId;
|
let itemId = aNode.itemId;
|
||||||
|
|
||||||
if (PlacesUtils.nodeIsHistoryContainer(aNode) ||
|
if (PlacesUtils.nodeIsHistoryContainer(aNode) ||
|
||||||
itemId == PlacesUIUtils.leftPaneQueries["History"]) {
|
itemId == PlacesUIUtils.leftPaneQueries.History) {
|
||||||
PlacesQueryBuilder.setScope("history");
|
PlacesQueryBuilder.setScope("history");
|
||||||
} else if (itemId == PlacesUIUtils.leftPaneQueries["Downloads"]) {
|
} else if (itemId == PlacesUIUtils.leftPaneQueries.Downloads) {
|
||||||
PlacesQueryBuilder.setScope("downloads");
|
PlacesQueryBuilder.setScope("downloads");
|
||||||
} else {
|
} else {
|
||||||
// Default to All Bookmarks for all other nodes, per bug 469437.
|
// Default to All Bookmarks for all other nodes, per bug 469437.
|
||||||
|
|
|
@ -83,7 +83,7 @@ add_task(async function() {
|
||||||
// Check left pane is populated.
|
// Check left pane is populated.
|
||||||
organizer.PlacesOrganizer.selectLeftPaneQuery("History");
|
organizer.PlacesOrganizer.selectLeftPaneQuery("History");
|
||||||
is(organizer.PlacesOrganizer._places.selectedNode.itemId,
|
is(organizer.PlacesOrganizer._places.selectedNode.itemId,
|
||||||
PlacesUIUtils.leftPaneQueries["History"],
|
PlacesUIUtils.leftPaneQueries.History,
|
||||||
"Library left pane is populated and working");
|
"Library left pane is populated and working");
|
||||||
|
|
||||||
await promiseLibraryClosed(organizer);
|
await promiseLibraryClosed(organizer);
|
||||||
|
|
|
@ -4,7 +4,7 @@ add_task(async function() {
|
||||||
info("Add a live bookmark editing its data");
|
info("Add a live bookmark editing its data");
|
||||||
|
|
||||||
await withSidebarTree("bookmarks", async function(tree) {
|
await withSidebarTree("bookmarks", async function(tree) {
|
||||||
let itemId = PlacesUIUtils.leftPaneQueries["UnfiledBookmarks"];
|
let itemId = PlacesUIUtils.leftPaneQueries.UnfiledBookmarks;
|
||||||
tree.selectItems([itemId]);
|
tree.selectItems([itemId]);
|
||||||
|
|
||||||
await withBookmarksDialog(
|
await withBookmarksDialog(
|
||||||
|
|
|
@ -4,7 +4,7 @@ add_task(async function() {
|
||||||
info("Bug 479348 - Properties on a root should be read-only.");
|
info("Bug 479348 - Properties on a root should be read-only.");
|
||||||
|
|
||||||
await withSidebarTree("bookmarks", async function(tree) {
|
await withSidebarTree("bookmarks", async function(tree) {
|
||||||
let itemId = PlacesUIUtils.leftPaneQueries["UnfiledBookmarks"];
|
let itemId = PlacesUIUtils.leftPaneQueries.UnfiledBookmarks;
|
||||||
tree.selectItems([itemId]);
|
tree.selectItems([itemId]);
|
||||||
ok(tree.controller.isCommandEnabled("placesCmd_show:info"),
|
ok(tree.controller.isCommandEnabled("placesCmd_show:info"),
|
||||||
"'placesCmd_show:info' on current selected node is enabled");
|
"'placesCmd_show:info' on current selected node is enabled");
|
||||||
|
|
|
@ -37,13 +37,13 @@ var testCases = [
|
||||||
},
|
},
|
||||||
|
|
||||||
function historyScope() {
|
function historyScope() {
|
||||||
let defScope = getDefaultScope(PlacesUIUtils.leftPaneQueries["History"]);
|
let defScope = getDefaultScope(PlacesUIUtils.leftPaneQueries.History);
|
||||||
search(PlacesUIUtils.leftPaneQueries["History"], "dummy", defScope);
|
search(PlacesUIUtils.leftPaneQueries.History, "dummy", defScope);
|
||||||
},
|
},
|
||||||
|
|
||||||
function downloadsScope() {
|
function downloadsScope() {
|
||||||
let defScope = getDefaultScope(PlacesUIUtils.leftPaneQueries["Downloads"]);
|
let defScope = getDefaultScope(PlacesUIUtils.leftPaneQueries.Downloads);
|
||||||
search(PlacesUIUtils.leftPaneQueries["Downloads"], "dummy", defScope);
|
search(PlacesUIUtils.leftPaneQueries.Downloads, "dummy", defScope);
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@ var testCases = [
|
||||||
*/
|
*/
|
||||||
function getDefaultScope(aFolderId) {
|
function getDefaultScope(aFolderId) {
|
||||||
switch (aFolderId) {
|
switch (aFolderId) {
|
||||||
case PlacesUIUtils.leftPaneQueries["History"]:
|
case PlacesUIUtils.leftPaneQueries.History:
|
||||||
return "scopeBarHistory"
|
return "scopeBarHistory"
|
||||||
case PlacesUIUtils.leftPaneQueries["Downloads"]:
|
case PlacesUIUtils.leftPaneQueries.Downloads:
|
||||||
return "scopeBarDownloads";
|
return "scopeBarDownloads";
|
||||||
default:
|
default:
|
||||||
return "scopeBarAll";
|
return "scopeBarAll";
|
||||||
|
@ -116,8 +116,8 @@ function search(aFolderId, aSearchStr, aExpectedScopeButtonId) {
|
||||||
|
|
||||||
// getFolders() on a History query returns an empty array, so no use
|
// getFolders() on a History query returns an empty array, so no use
|
||||||
// comparing against aFolderId in that case.
|
// comparing against aFolderId in that case.
|
||||||
if (aFolderId !== PlacesUIUtils.leftPaneQueries["History"] &&
|
if (aFolderId !== PlacesUIUtils.leftPaneQueries.History &&
|
||||||
aFolderId !== PlacesUIUtils.leftPaneQueries["Downloads"]) {
|
aFolderId !== PlacesUIUtils.leftPaneQueries.Downloads) {
|
||||||
// contentTree.place should be equal to contentTree.result.root.uri,
|
// contentTree.place should be equal to contentTree.result.root.uri,
|
||||||
// but it's not until bug 476952 is fixed.
|
// but it's not until bug 476952 is fixed.
|
||||||
let query = queryStringToQuery(contentTree.result.root.uri);
|
let query = queryStringToQuery(contentTree.result.root.uri);
|
||||||
|
|
|
@ -214,8 +214,8 @@ var gCookiesWindow = {
|
||||||
var cacheIndex = Math.min(this._cacheValid, aIndex);
|
var cacheIndex = Math.min(this._cacheValid, aIndex);
|
||||||
if (cacheIndex > 0) {
|
if (cacheIndex > 0) {
|
||||||
var cacheItem = this._cacheItems[cacheIndex];
|
var cacheItem = this._cacheItems[cacheIndex];
|
||||||
start = cacheItem["start"];
|
start = cacheItem.start;
|
||||||
count = hostIndex = cacheItem["count"];
|
count = hostIndex = cacheItem.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = start; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
|
for (let i = start; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
function collect() {
|
function collect() {
|
||||||
let result = {};
|
let result = {};
|
||||||
|
|
||||||
result["appCodeName"] = navigator.appCodeName;
|
result.appCodeName = navigator.appCodeName;
|
||||||
result["appName"] = navigator.appName;
|
result.appName = navigator.appName;
|
||||||
result["appVersion"] = navigator.appVersion;
|
result.appVersion = navigator.appVersion;
|
||||||
result["platform"] = navigator.platform;
|
result.platform = navigator.platform;
|
||||||
result["userAgent"] = navigator.userAgent;
|
result.userAgent = navigator.userAgent;
|
||||||
result["product"] = navigator.product;
|
result.product = navigator.product;
|
||||||
result["productSub"] = navigator.productSub;
|
result.productSub = navigator.productSub;
|
||||||
result["vendor"] = navigator.vendor;
|
result.vendor = navigator.vendor;
|
||||||
result["vendorSub"] = navigator.vendorSub;
|
result.vendorSub = navigator.vendorSub;
|
||||||
result["mimeTypesLength"] = navigator.mimeTypes.length;
|
result.mimeTypesLength = navigator.mimeTypes.length;
|
||||||
result["pluginsLength"] = navigator.plugins.length;
|
result.pluginsLength = navigator.plugins.length;
|
||||||
result["oscpu"] = navigator.oscpu;
|
result.oscpu = navigator.oscpu;
|
||||||
result["buildID"] = navigator.buildID;
|
result.buildID = navigator.buildID;
|
||||||
result["hardwareConcurrency"] = navigator.hardwareConcurrency;
|
result.hardwareConcurrency = navigator.hardwareConcurrency;
|
||||||
|
|
||||||
// eslint-disable-next-line no-unsanitized/property
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
document.getElementById("result").innerHTML = JSON.stringify(result);
|
document.getElementById("result").innerHTML = JSON.stringify(result);
|
||||||
|
|
|
@ -6,13 +6,13 @@ onconnect = function(e) {
|
||||||
let navigatorObj = self.navigator;
|
let navigatorObj = self.navigator;
|
||||||
let result = {};
|
let result = {};
|
||||||
|
|
||||||
result["appCodeName"] = navigatorObj.appCodeName;
|
result.appCodeName = navigatorObj.appCodeName;
|
||||||
result["appName"] = navigatorObj.appName;
|
result.appName = navigatorObj.appName;
|
||||||
result["appVersion"] = navigatorObj.appVersion;
|
result.appVersion = navigatorObj.appVersion;
|
||||||
result["platform"] = navigatorObj.platform;
|
result.platform = navigatorObj.platform;
|
||||||
result["userAgent"] = navigatorObj.userAgent;
|
result.userAgent = navigatorObj.userAgent;
|
||||||
result["product"] = navigatorObj.product;
|
result.product = navigatorObj.product;
|
||||||
result["hardwareConcurrency"] = navigatorObj.hardwareConcurrency;
|
result.hardwareConcurrency = navigatorObj.hardwareConcurrency;
|
||||||
|
|
||||||
port.postMessage(JSON.stringify(result));
|
port.postMessage(JSON.stringify(result));
|
||||||
port.start();
|
port.start();
|
||||||
|
|
|
@ -13,6 +13,6 @@ storageTestItem = <span id="storageTestItem">FAIL</span>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
document.getElementById("storageTestItem").textContent =
|
document.getElementById("storageTestItem").textContent =
|
||||||
sessionStorage["storageTestItem"] || "PENDING";
|
sessionStorage.storageTestItem || "PENDING";
|
||||||
sessionStorage["storageTestItem"] = "SUCCESS";
|
sessionStorage.storageTestItem = "SUCCESS";
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -57,15 +57,15 @@ async function checkState(prefix, tab) {
|
||||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
let {formdata} = JSON.parse(ss.getTabState(tab));
|
let {formdata} = JSON.parse(ss.getTabState(tab));
|
||||||
|
|
||||||
ok(formdata.id["sessionData"], prefix + ": we have form data for about:sessionrestore");
|
ok(formdata.id.sessionData, prefix + ": we have form data for about:sessionrestore");
|
||||||
|
|
||||||
let sessionData_raw = JSON.stringify(formdata.id["sessionData"]);
|
let sessionData_raw = JSON.stringify(formdata.id.sessionData);
|
||||||
ok(!/\\/.test(sessionData_raw), prefix + ": #sessionData contains no backslashes");
|
ok(!/\\/.test(sessionData_raw), prefix + ": #sessionData contains no backslashes");
|
||||||
info(sessionData_raw);
|
info(sessionData_raw);
|
||||||
|
|
||||||
let gotError = false;
|
let gotError = false;
|
||||||
try {
|
try {
|
||||||
JSON.parse(formdata.id["sessionData"]);
|
JSON.parse(formdata.id.sessionData);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
info(prefix + ": got error: " + e);
|
info(prefix + ": got error: " + e);
|
||||||
gotError = true;
|
gotError = true;
|
||||||
|
|
|
@ -13,7 +13,7 @@ function test() {
|
||||||
promiseBrowserLoaded(tab.linkedBrowser).then(() => {
|
promiseBrowserLoaded(tab.linkedBrowser).then(() => {
|
||||||
ss.setTabValue(tab, "bug485563", uniqueValue);
|
ss.setTabValue(tab, "bug485563", uniqueValue);
|
||||||
let tabState = JSON.parse(ss.getTabState(tab));
|
let tabState = JSON.parse(ss.getTabState(tab));
|
||||||
is(tabState.extData["bug485563"], uniqueValue,
|
is(tabState.extData.bug485563, uniqueValue,
|
||||||
"unicode line separator wasn't over-encoded");
|
"unicode line separator wasn't over-encoded");
|
||||||
ss.deleteTabValue(tab, "bug485563");
|
ss.deleteTabValue(tab, "bug485563");
|
||||||
ss.setTabState(tab, JSON.stringify(tabState));
|
ss.setTabState(tab, JSON.stringify(tabState));
|
||||||
|
|
|
@ -67,7 +67,7 @@ function test() {
|
||||||
for (let i = gBrowser.tabs.length - 1; i >= 0; i--) {
|
for (let i = gBrowser.tabs.length - 1; i >= 0; i--) {
|
||||||
let tab = gBrowser.tabs[i];
|
let tab = gBrowser.tabs[i];
|
||||||
let actualUniq = ss.getTabValue(tab, "uniq");
|
let actualUniq = ss.getTabValue(tab, "uniq");
|
||||||
let expectedUniq = state.windows[0].tabs[i].extData["uniq"];
|
let expectedUniq = state.windows[0].tabs[i].extData.uniq;
|
||||||
|
|
||||||
if (wasLoaded[actualUniq]) {
|
if (wasLoaded[actualUniq]) {
|
||||||
info("tab " + i + ": already restored");
|
info("tab " + i + ": already restored");
|
||||||
|
|
|
@ -27,7 +27,7 @@ add_task(async function() {
|
||||||
let tabState = state.windows[0].tabs[i];
|
let tabState = state.windows[0].tabs[i];
|
||||||
let tabCurState = curState.windows[0].tabs[i];
|
let tabCurState = curState.windows[0].tabs[i];
|
||||||
if (tabState.extData) {
|
if (tabState.extData) {
|
||||||
is(tabCurState.extData["uniq"], tabState.extData["uniq"],
|
is(tabCurState.extData.uniq, tabState.extData.uniq,
|
||||||
"sanity check that tab has correct extData");
|
"sanity check that tab has correct extData");
|
||||||
} else {
|
} else {
|
||||||
// We aren't expecting there to be any data on extData, but panorama
|
// We aren't expecting there to be any data on extData, but panorama
|
||||||
|
|
|
@ -26,7 +26,7 @@ function test() {
|
||||||
is(browser.__SS_restoreState, TAB_STATE_NEEDS_RESTORE, "tab needs restoring");
|
is(browser.__SS_restoreState, TAB_STATE_NEEDS_RESTORE, "tab needs restoring");
|
||||||
|
|
||||||
let {formdata} = JSON.parse(ss.getTabState(tab));
|
let {formdata} = JSON.parse(ss.getTabState(tab));
|
||||||
is(formdata && formdata.id["foo"], "bar", "tab state's formdata is valid");
|
is(formdata && formdata.id.foo, "bar", "tab state's formdata is valid");
|
||||||
|
|
||||||
promiseTabRestored(tab).then(() => {
|
promiseTabRestored(tab).then(() => {
|
||||||
ContentTask.spawn(browser, null, function() {
|
ContentTask.spawn(browser, null, function() {
|
||||||
|
|
|
@ -13,9 +13,9 @@ const OUTER_VALUE = "outer-value-" + RAND;
|
||||||
function getEstimateChars() {
|
function getEstimateChars() {
|
||||||
let snap;
|
let snap;
|
||||||
if (gMultiProcessBrowser) {
|
if (gMultiProcessBrowser) {
|
||||||
snap = Services.telemetry.histogramSnapshots.content["FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS"];
|
snap = Services.telemetry.histogramSnapshots.content.FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS;
|
||||||
} else {
|
} else {
|
||||||
snap = Services.telemetry.histogramSnapshots.parent["FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS"];
|
snap = Services.telemetry.histogramSnapshots.parent.FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS;
|
||||||
}
|
}
|
||||||
if (!snap) {
|
if (!snap) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -154,7 +154,7 @@ var gSetBackground = {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (AppConstants.platform != "macosx") {
|
if (AppConstants.platform != "macosx") {
|
||||||
gSetBackground["_initColor"] = function() {
|
gSetBackground._initColor = function() {
|
||||||
var color = this._shell.desktopBackgroundColor;
|
var color = this._shell.desktopBackgroundColor;
|
||||||
|
|
||||||
const rMask = 4294901760;
|
const rMask = 4294901760;
|
||||||
|
@ -169,24 +169,24 @@ if (AppConstants.platform != "macosx") {
|
||||||
colorpicker.color = this._backgroundColor;
|
colorpicker.color = this._backgroundColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
gSetBackground["updateColor"] = function(aColor) {
|
gSetBackground.updateColor = function(aColor) {
|
||||||
this._backgroundColor = aColor;
|
this._backgroundColor = aColor;
|
||||||
this._canvas.style.backgroundColor = aColor;
|
this._canvas.style.backgroundColor = aColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Converts a color string in the format "#RRGGBB" to an integer.
|
// Converts a color string in the format "#RRGGBB" to an integer.
|
||||||
gSetBackground["_hexStringToLong"] = function(aString) {
|
gSetBackground._hexStringToLong = function(aString) {
|
||||||
return parseInt(aString.substring(1, 3), 16) << 16 |
|
return parseInt(aString.substring(1, 3), 16) << 16 |
|
||||||
parseInt(aString.substring(3, 5), 16) << 8 |
|
parseInt(aString.substring(3, 5), 16) << 8 |
|
||||||
parseInt(aString.substring(5, 7), 16);
|
parseInt(aString.substring(5, 7), 16);
|
||||||
};
|
};
|
||||||
|
|
||||||
gSetBackground["_rgbToHex"] = function(aR, aG, aB) {
|
gSetBackground._rgbToHex = function(aR, aG, aB) {
|
||||||
return "#" + [aR, aG, aB].map(aInt => aInt.toString(16).replace(/^(.)$/, "0$1"))
|
return "#" + [aR, aG, aB].map(aInt => aInt.toString(16).replace(/^(.)$/, "0$1"))
|
||||||
.join("").toUpperCase();
|
.join("").toUpperCase();
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
gSetBackground["observe"] = function(aSubject, aTopic, aData) {
|
gSetBackground.observe = function(aSubject, aTopic, aData) {
|
||||||
if (aTopic == "shell:desktop-background-changed") {
|
if (aTopic == "shell:desktop-background-changed") {
|
||||||
document.getElementById("setDesktopBackground").hidden = true;
|
document.getElementById("setDesktopBackground").hidden = true;
|
||||||
document.getElementById("showDesktopPreferences").hidden = false;
|
document.getElementById("showDesktopPreferences").hidden = false;
|
||||||
|
@ -197,7 +197,7 @@ if (AppConstants.platform != "macosx") {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gSetBackground["showDesktopPrefs"] = function() {
|
gSetBackground.showDesktopPrefs = function() {
|
||||||
this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP);
|
this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1584,7 +1584,7 @@ this.UITour = {
|
||||||
// Services.appinfo.distributionID (value of MOZ_DISTRIBUTION_ID is set at build time).
|
// Services.appinfo.distributionID (value of MOZ_DISTRIBUTION_ID is set at build time).
|
||||||
let distribution =
|
let distribution =
|
||||||
Services.prefs.getDefaultBranch("distribution.").getCharPref("id", "default");
|
Services.prefs.getDefaultBranch("distribution.").getCharPref("id", "default");
|
||||||
appinfo["distribution"] = distribution;
|
appinfo.distribution = distribution;
|
||||||
|
|
||||||
let isDefaultBrowser = null;
|
let isDefaultBrowser = null;
|
||||||
try {
|
try {
|
||||||
|
@ -1593,7 +1593,7 @@ this.UITour = {
|
||||||
isDefaultBrowser = shell.isDefaultBrowser(false);
|
isDefaultBrowser = shell.isDefaultBrowser(false);
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
appinfo["defaultBrowser"] = isDefaultBrowser;
|
appinfo.defaultBrowser = isDefaultBrowser;
|
||||||
|
|
||||||
let canSetDefaultBrowserInBackground = true;
|
let canSetDefaultBrowserInBackground = true;
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2") ||
|
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2") ||
|
||||||
|
@ -1608,7 +1608,7 @@ this.UITour = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
appinfo["canSetDefaultBrowserInBackground"] =
|
appinfo.canSetDefaultBrowserInBackground =
|
||||||
canSetDefaultBrowserInBackground;
|
canSetDefaultBrowserInBackground;
|
||||||
|
|
||||||
// Expose Profile creation and last reset dates in weeks.
|
// Expose Profile creation and last reset dates in weeks.
|
||||||
|
@ -1621,8 +1621,8 @@ this.UITour = {
|
||||||
if (resetDate) {
|
if (resetDate) {
|
||||||
resetWeeksAgo = Math.floor((Date.now() - resetDate) / ONE_WEEK);
|
resetWeeksAgo = Math.floor((Date.now() - resetDate) / ONE_WEEK);
|
||||||
}
|
}
|
||||||
appinfo["profileCreatedWeeksAgo"] = createdWeeksAgo;
|
appinfo.profileCreatedWeeksAgo = createdWeeksAgo;
|
||||||
appinfo["profileResetWeeksAgo"] = resetWeeksAgo;
|
appinfo.profileResetWeeksAgo = resetWeeksAgo;
|
||||||
|
|
||||||
this.sendPageCallback(aMessageManager, aCallbackID, appinfo);
|
this.sendPageCallback(aMessageManager, aCallbackID, appinfo);
|
||||||
})().catch(err => {
|
})().catch(err => {
|
||||||
|
|
|
@ -388,7 +388,7 @@ add_task(async function test_expiration() {
|
||||||
|
|
||||||
// Test that experiments that are cached locally but never ran are removed from cache
|
// Test that experiments that are cached locally but never ran are removed from cache
|
||||||
// when they are removed from the manifest (this is cached data, not really history).
|
// when they are removed from the manifest (this is cached data, not really history).
|
||||||
gManifestObject["experiments"] = gManifestObject["experiments"].slice(1, 1);
|
gManifestObject.experiments = gManifestObject.experiments.slice(1, 1);
|
||||||
await experiments.updateManifest();
|
await experiments.updateManifest();
|
||||||
validateCache([...experiments._experiments.keys()], [EXPERIMENT2_ID]);
|
validateCache([...experiments._experiments.keys()], [EXPERIMENT2_ID]);
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,6 @@ module.exports = {
|
||||||
// Enforce dots on the next line with property name.
|
// Enforce dots on the next line with property name.
|
||||||
"dot-location": ["error", "property"],
|
"dot-location": ["error", "property"],
|
||||||
|
|
||||||
// Encourage the use of dot notation whenever possible.
|
|
||||||
"dot-notation": "error",
|
|
||||||
|
|
||||||
// Maximum length of a line.
|
// Maximum length of a line.
|
||||||
// This should be 100 but too many lines were longer than that so set a
|
// This should be 100 but too many lines were longer than that so set a
|
||||||
// conservative upper bound for now.
|
// conservative upper bound for now.
|
||||||
|
|
|
@ -174,12 +174,12 @@ var pktApi = (function() {
|
||||||
var pocketCookies = getCookiesFromPocket();
|
var pocketCookies = getCookiesFromPocket();
|
||||||
|
|
||||||
// If no cookie was found just return undefined
|
// If no cookie was found just return undefined
|
||||||
if (typeof pocketCookies["ftv1"] === "undefined") {
|
if (typeof pocketCookies.ftv1 === "undefined") {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if a new user logged in in the meantime and clearUserData if so
|
// Check if a new user logged in in the meantime and clearUserData if so
|
||||||
var sessionId = pocketCookies["fsv1"];
|
var sessionId = pocketCookies.fsv1;
|
||||||
var lastSessionId = getSetting("fsv1");
|
var lastSessionId = getSetting("fsv1");
|
||||||
if (sessionId !== lastSessionId) {
|
if (sessionId !== lastSessionId) {
|
||||||
clearUserData();
|
clearUserData();
|
||||||
|
@ -187,7 +187,7 @@ var pktApi = (function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return access token
|
// Return access token
|
||||||
return pocketCookies["ftv1"];
|
return pocketCookies.ftv1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +199,7 @@ var pktApi = (function() {
|
||||||
if (typeof premiumStatus === "undefined") {
|
if (typeof premiumStatus === "undefined") {
|
||||||
// Premium status is not in settings try get it from cookie
|
// Premium status is not in settings try get it from cookie
|
||||||
var pocketCookies = getCookiesFromPocket();
|
var pocketCookies = getCookiesFromPocket();
|
||||||
premiumStatus = pocketCookies["ps"];
|
premiumStatus = pocketCookies.ps;
|
||||||
}
|
}
|
||||||
return premiumStatus;
|
return premiumStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ function experimentFactory(attrs) {
|
||||||
|
|
||||||
// clearAllExperimentStorage
|
// clearAllExperimentStorage
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
experiments["test"] = experimentFactory({name: "test"});
|
experiments.test = experimentFactory({name: "test"});
|
||||||
ok(await PreferenceExperiments.has("test"), "Mock experiment is detected.");
|
ok(await PreferenceExperiments.has("test"), "Mock experiment is detected.");
|
||||||
await PreferenceExperiments.clearAllExperimentStorage();
|
await PreferenceExperiments.clearAllExperimentStorage();
|
||||||
ok(
|
ok(
|
||||||
|
@ -35,7 +35,7 @@ add_task(withMockExperiments(async function(experiments) {
|
||||||
|
|
||||||
// start should throw if an experiment with the given name already exists
|
// start should throw if an experiment with the given name already exists
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
experiments["test"] = experimentFactory({name: "test"});
|
experiments.test = experimentFactory({name: "test"});
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
PreferenceExperiments.start({
|
PreferenceExperiments.start({
|
||||||
name: "test",
|
name: "test",
|
||||||
|
@ -51,7 +51,7 @@ add_task(withMockExperiments(async function(experiments) {
|
||||||
|
|
||||||
// start should throw if an experiment for the given preference is active
|
// start should throw if an experiment for the given preference is active
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
experiments["test"] = experimentFactory({name: "test", preferenceName: "fake.preference"});
|
experiments.test = experimentFactory({name: "test", preferenceName: "fake.preference"});
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
PreferenceExperiments.start({
|
PreferenceExperiments.start({
|
||||||
name: "different",
|
name: "different",
|
||||||
|
@ -308,10 +308,10 @@ add_task(withMockExperiments(async function() {
|
||||||
// markLastSeen should update the lastSeen date
|
// markLastSeen should update the lastSeen date
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
const oldDate = new Date(1988, 10, 1).toJSON();
|
const oldDate = new Date(1988, 10, 1).toJSON();
|
||||||
experiments["test"] = experimentFactory({name: "test", lastSeen: oldDate});
|
experiments.test = experimentFactory({name: "test", lastSeen: oldDate});
|
||||||
await PreferenceExperiments.markLastSeen("test");
|
await PreferenceExperiments.markLastSeen("test");
|
||||||
Assert.notEqual(
|
Assert.notEqual(
|
||||||
experiments["test"].lastSeen,
|
experiments.test.lastSeen,
|
||||||
oldDate,
|
oldDate,
|
||||||
"markLastSeen updated the experiment lastSeen date",
|
"markLastSeen updated the experiment lastSeen date",
|
||||||
);
|
);
|
||||||
|
@ -327,7 +327,7 @@ add_task(withMockExperiments(async function() {
|
||||||
|
|
||||||
// stop should throw if the experiment is already expired
|
// stop should throw if the experiment is already expired
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
experiments["test"] = experimentFactory({name: "test", expired: true});
|
experiments.test = experimentFactory({name: "test", expired: true});
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
PreferenceExperiments.stop("test"),
|
PreferenceExperiments.stop("test"),
|
||||||
"stop threw an error because the experiment was already expired",
|
"stop threw an error because the experiment was already expired",
|
||||||
|
@ -340,7 +340,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
const stopObserver = sinon.spy(PreferenceExperiments, "stopObserver");
|
const stopObserver = sinon.spy(PreferenceExperiments, "stopObserver");
|
||||||
|
|
||||||
mockPreferences.set("fake.preference", "experimentvalue", "default");
|
mockPreferences.set("fake.preference", "experimentvalue", "default");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
|
@ -353,7 +353,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
|
|
||||||
await PreferenceExperiments.stop("test");
|
await PreferenceExperiments.stop("test");
|
||||||
ok(stopObserver.calledWith("test"), "stop removed an observer");
|
ok(stopObserver.calledWith("test"), "stop removed an observer");
|
||||||
is(experiments["test"].expired, true, "stop marked the experiment as expired");
|
is(experiments.test.expired, true, "stop marked the experiment as expired");
|
||||||
is(
|
is(
|
||||||
DefaultPreferences.get("fake.preference"),
|
DefaultPreferences.get("fake.preference"),
|
||||||
"oldvalue",
|
"oldvalue",
|
||||||
|
@ -368,7 +368,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
||||||
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
||||||
mockPreferences.set("fake.preference", "experimentvalue", "user");
|
mockPreferences.set("fake.preference", "experimentvalue", "user");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
|
@ -381,7 +381,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
|
|
||||||
await PreferenceExperiments.stop("test");
|
await PreferenceExperiments.stop("test");
|
||||||
ok(stopObserver.calledWith("test"), "stop removed an observer");
|
ok(stopObserver.calledWith("test"), "stop removed an observer");
|
||||||
is(experiments["test"].expired, true, "stop marked the experiment as expired");
|
is(experiments.test.expired, true, "stop marked the experiment as expired");
|
||||||
is(
|
is(
|
||||||
Preferences.get("fake.preference"),
|
Preferences.get("fake.preference"),
|
||||||
"oldvalue",
|
"oldvalue",
|
||||||
|
@ -394,7 +394,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
// stop should not call stopObserver if there is no observer registered.
|
// stop should not call stopObserver if there is no observer registered.
|
||||||
add_task(withMockExperiments(withMockPreferences(async function(experiments) {
|
add_task(withMockExperiments(withMockPreferences(async function(experiments) {
|
||||||
const stopObserver = sinon.spy(PreferenceExperiments, "stopObserver");
|
const stopObserver = sinon.spy(PreferenceExperiments, "stopObserver");
|
||||||
experiments["test"] = experimentFactory({name: "test", expired: false});
|
experiments.test = experimentFactory({name: "test", expired: false});
|
||||||
|
|
||||||
await PreferenceExperiments.stop("test");
|
await PreferenceExperiments.stop("test");
|
||||||
ok(!stopObserver.called, "stop did not bother to stop an observer that wasn't active");
|
ok(!stopObserver.called, "stop did not bother to stop an observer that wasn't active");
|
||||||
|
@ -407,7 +407,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments) {
|
||||||
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
||||||
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
||||||
mockPreferences.set("fake.preference", "experimentvalue", "user");
|
mockPreferences.set("fake.preference", "experimentvalue", "user");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
|
@ -430,7 +430,7 @@ add_task(withMockExperiments(withMockPreferences(async function(experiments, moc
|
||||||
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function(experiments, mockPreferences) {
|
||||||
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
const stopObserver = sinon.stub(PreferenceExperiments, "stopObserver");
|
||||||
mockPreferences.set("fake.preference", "customvalue", "default");
|
mockPreferences.set("fake.preference", "customvalue", "default");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
|
@ -461,21 +461,21 @@ add_task(withMockExperiments(async function() {
|
||||||
// get
|
// get
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
const experiment = experimentFactory({name: "test"});
|
const experiment = experimentFactory({name: "test"});
|
||||||
experiments["test"] = experiment;
|
experiments.test = experiment;
|
||||||
|
|
||||||
const fetchedExperiment = await PreferenceExperiments.get("test");
|
const fetchedExperiment = await PreferenceExperiments.get("test");
|
||||||
Assert.deepEqual(fetchedExperiment, experiment, "get fetches the correct experiment");
|
Assert.deepEqual(fetchedExperiment, experiment, "get fetches the correct experiment");
|
||||||
|
|
||||||
// Modifying the fetched experiment must not edit the data source.
|
// Modifying the fetched experiment must not edit the data source.
|
||||||
fetchedExperiment.name = "othername";
|
fetchedExperiment.name = "othername";
|
||||||
is(experiments["test"].name, "test", "get returns a copy of the experiment");
|
is(experiments.test.name, "test", "get returns a copy of the experiment");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
add_task(withMockExperiments(async function testGetAll(experiments) {
|
add_task(withMockExperiments(async function testGetAll(experiments) {
|
||||||
const experiment1 = experimentFactory({name: "experiment1"});
|
const experiment1 = experimentFactory({name: "experiment1"});
|
||||||
const experiment2 = experimentFactory({name: "experiment2", disabled: true});
|
const experiment2 = experimentFactory({name: "experiment2", disabled: true});
|
||||||
experiments["experiment1"] = experiment1;
|
experiments.experiment1 = experiment1;
|
||||||
experiments["experiment2"] = experiment2;
|
experiments.experiment2 = experiment2;
|
||||||
|
|
||||||
const fetchedExperiments = await PreferenceExperiments.getAll();
|
const fetchedExperiments = await PreferenceExperiments.getAll();
|
||||||
is(fetchedExperiments.length, 2, "getAll returns a list of all stored experiments");
|
is(fetchedExperiments.length, 2, "getAll returns a list of all stored experiments");
|
||||||
|
@ -496,11 +496,11 @@ add_task(withMockExperiments(async function testGetAll(experiments) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
add_task(withMockExperiments(withMockPreferences(async function testGetAllActive(experiments) {
|
add_task(withMockExperiments(withMockPreferences(async function testGetAllActive(experiments) {
|
||||||
experiments["active"] = experimentFactory({
|
experiments.active = experimentFactory({
|
||||||
name: "active",
|
name: "active",
|
||||||
expired: false,
|
expired: false,
|
||||||
});
|
});
|
||||||
experiments["inactive"] = experimentFactory({
|
experiments.inactive = experimentFactory({
|
||||||
name: "inactive",
|
name: "inactive",
|
||||||
expired: true,
|
expired: true,
|
||||||
});
|
});
|
||||||
|
@ -508,13 +508,13 @@ add_task(withMockExperiments(withMockPreferences(async function testGetAllActive
|
||||||
const activeExperiments = await PreferenceExperiments.getAllActive();
|
const activeExperiments = await PreferenceExperiments.getAllActive();
|
||||||
Assert.deepEqual(
|
Assert.deepEqual(
|
||||||
activeExperiments,
|
activeExperiments,
|
||||||
[experiments["active"]],
|
[experiments.active],
|
||||||
"getAllActive only returns active experiments",
|
"getAllActive only returns active experiments",
|
||||||
);
|
);
|
||||||
|
|
||||||
activeExperiments[0].name = "newfakename";
|
activeExperiments[0].name = "newfakename";
|
||||||
Assert.notEqual(
|
Assert.notEqual(
|
||||||
experiments["active"].name,
|
experiments.active.name,
|
||||||
"newfakename",
|
"newfakename",
|
||||||
"getAllActive returns copies of stored experiments",
|
"getAllActive returns copies of stored experiments",
|
||||||
);
|
);
|
||||||
|
@ -522,14 +522,14 @@ add_task(withMockExperiments(withMockPreferences(async function testGetAllActive
|
||||||
|
|
||||||
// has
|
// has
|
||||||
add_task(withMockExperiments(async function(experiments) {
|
add_task(withMockExperiments(async function(experiments) {
|
||||||
experiments["test"] = experimentFactory({name: "test"});
|
experiments.test = experimentFactory({name: "test"});
|
||||||
ok(await PreferenceExperiments.has("test"), "has returned true for a stored experiment");
|
ok(await PreferenceExperiments.has("test"), "has returned true for a stored experiment");
|
||||||
ok(!(await PreferenceExperiments.has("missing")), "has returned false for a missing experiment");
|
ok(!(await PreferenceExperiments.has("missing")), "has returned false for a missing experiment");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// init should set the default preference value for active, default experiments
|
// init should set the default preference value for active, default experiments
|
||||||
add_task(withMockExperiments(withMockPreferences(async function testInit(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function testInit(experiments, mockPreferences) {
|
||||||
experiments["user"] = experimentFactory({
|
experiments.user = experimentFactory({
|
||||||
name: "user",
|
name: "user",
|
||||||
preferenceName: "user",
|
preferenceName: "user",
|
||||||
preferenceValue: true,
|
preferenceValue: true,
|
||||||
|
@ -537,7 +537,7 @@ add_task(withMockExperiments(withMockPreferences(async function testInit(experim
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceBranchType: "user",
|
preferenceBranchType: "user",
|
||||||
});
|
});
|
||||||
experiments["default"] = experimentFactory({
|
experiments.default = experimentFactory({
|
||||||
name: "default",
|
name: "default",
|
||||||
preferenceName: "default",
|
preferenceName: "default",
|
||||||
preferenceValue: true,
|
preferenceValue: true,
|
||||||
|
@ -545,7 +545,7 @@ add_task(withMockExperiments(withMockPreferences(async function testInit(experim
|
||||||
expired: false,
|
expired: false,
|
||||||
preferenceBranchType: "default",
|
preferenceBranchType: "default",
|
||||||
});
|
});
|
||||||
experiments["expireddefault"] = experimentFactory({
|
experiments.expireddefault = experimentFactory({
|
||||||
name: "expireddefault",
|
name: "expireddefault",
|
||||||
preferenceName: "expireddefault",
|
preferenceName: "expireddefault",
|
||||||
preferenceValue: true,
|
preferenceValue: true,
|
||||||
|
@ -579,7 +579,7 @@ add_task(withMockExperiments(withMockPreferences(async function testInit(experim
|
||||||
const startObserverStub = sinon.stub(PreferenceExperiments, "startObserver");
|
const startObserverStub = sinon.stub(PreferenceExperiments, "startObserver");
|
||||||
mockPreferences.set("fake.pref", "experiment value");
|
mockPreferences.set("fake.pref", "experiment value");
|
||||||
|
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
branch: "branch",
|
branch: "branch",
|
||||||
preferenceName: "fake.pref",
|
preferenceName: "fake.pref",
|
||||||
|
@ -619,7 +619,7 @@ add_task(withMockExperiments(async function testInitTelemetry() {
|
||||||
// Experiments shouldn't be recorded by init() in telemetry if they are expired
|
// Experiments shouldn't be recorded by init() in telemetry if they are expired
|
||||||
add_task(withMockExperiments(async function testInitTelemetryExpired(experiments) {
|
add_task(withMockExperiments(async function testInitTelemetryExpired(experiments) {
|
||||||
const setActiveStub = sinon.stub(TelemetryEnvironment, "setExperimentActive");
|
const setActiveStub = sinon.stub(TelemetryEnvironment, "setExperimentActive");
|
||||||
experiments["experiment1"] = experimentFactory({name: "expired", branch: "branch", expired: true});
|
experiments.experiment1 = experimentFactory({name: "expired", branch: "branch", expired: true});
|
||||||
await PreferenceExperiments.init();
|
await PreferenceExperiments.init();
|
||||||
ok(!setActiveStub.called, "Expired experiment is not registered by init");
|
ok(!setActiveStub.called, "Expired experiment is not registered by init");
|
||||||
setActiveStub.restore();
|
setActiveStub.restore();
|
||||||
|
@ -629,7 +629,7 @@ add_task(withMockExperiments(async function testInitTelemetryExpired(experiments
|
||||||
add_task(withMockExperiments(withMockPreferences(async function testInitChanges(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function testInitChanges(experiments, mockPreferences) {
|
||||||
const stopStub = sinon.stub(PreferenceExperiments, "stop");
|
const stopStub = sinon.stub(PreferenceExperiments, "stop");
|
||||||
mockPreferences.set("fake.preference", "experiment value", "default");
|
mockPreferences.set("fake.preference", "experiment value", "default");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
preferenceValue: "experiment value",
|
preferenceValue: "experiment value",
|
||||||
|
@ -646,7 +646,7 @@ add_task(withMockExperiments(withMockPreferences(async function testInitChanges(
|
||||||
add_task(withMockExperiments(withMockPreferences(async function testInitRegistersObserver(experiments, mockPreferences) {
|
add_task(withMockExperiments(withMockPreferences(async function testInitRegistersObserver(experiments, mockPreferences) {
|
||||||
const startObserver = sinon.stub(PreferenceExperiments, "startObserver");
|
const startObserver = sinon.stub(PreferenceExperiments, "startObserver");
|
||||||
mockPreferences.set("fake.preference", "experiment value", "default");
|
mockPreferences.set("fake.preference", "experiment value", "default");
|
||||||
experiments["test"] = experimentFactory({
|
experiments.test = experimentFactory({
|
||||||
name: "test",
|
name: "test",
|
||||||
preferenceName: "fake.preference",
|
preferenceName: "fake.preference",
|
||||||
preferenceValue: "experiment value",
|
preferenceValue: "experiment value",
|
||||||
|
|
|
@ -123,8 +123,8 @@ add_task(withMockNormandyApi(async function testRun(mockApi) {
|
||||||
mockApi.recipes = [matchRecipe, noMatchRecipe, missingRecipe];
|
mockApi.recipes = [matchRecipe, noMatchRecipe, missingRecipe];
|
||||||
|
|
||||||
await withMockActionSandboxManagers(mockApi.actions, async managers => {
|
await withMockActionSandboxManagers(mockApi.actions, async managers => {
|
||||||
const matchManager = managers["matchAction"];
|
const matchManager = managers.matchAction;
|
||||||
const noMatchManager = managers["noMatchAction"];
|
const noMatchManager = managers.noMatchAction;
|
||||||
|
|
||||||
await RecipeRunner.run();
|
await RecipeRunner.run();
|
||||||
|
|
||||||
|
@ -155,8 +155,8 @@ add_task(withMockNormandyApi(async function testRunPreExecutionFailure(mockApi)
|
||||||
mockApi.recipes = [passRecipe, failRecipe];
|
mockApi.recipes = [passRecipe, failRecipe];
|
||||||
|
|
||||||
await withMockActionSandboxManagers(mockApi.actions, async managers => {
|
await withMockActionSandboxManagers(mockApi.actions, async managers => {
|
||||||
const passManager = managers["passAction"];
|
const passManager = managers.passAction;
|
||||||
const failManager = managers["failAction"];
|
const failManager = managers.failAction;
|
||||||
failManager.runAsyncCallback.returns(Promise.reject(new Error("oh no")));
|
failManager.runAsyncCallback.returns(Promise.reject(new Error("oh no")));
|
||||||
|
|
||||||
await RecipeRunner.run();
|
await RecipeRunner.run();
|
||||||
|
@ -181,13 +181,13 @@ add_task(withMockNormandyApi(async function testLoadActionSandboxManagers(mockAp
|
||||||
{name: "normalAction"},
|
{name: "normalAction"},
|
||||||
{name: "missingImpl"},
|
{name: "missingImpl"},
|
||||||
];
|
];
|
||||||
mockApi.implementations["normalAction"] = "window.scriptRan = true";
|
mockApi.implementations.normalAction = "window.scriptRan = true";
|
||||||
|
|
||||||
const managers = await RecipeRunner.loadActionSandboxManagers();
|
const managers = await RecipeRunner.loadActionSandboxManagers();
|
||||||
ok("normalAction" in managers, "Actions with implementations have managers");
|
ok("normalAction" in managers, "Actions with implementations have managers");
|
||||||
ok(!("missingImpl" in managers), "Actions without implementations are skipped");
|
ok(!("missingImpl" in managers), "Actions without implementations are skipped");
|
||||||
|
|
||||||
const normalManager = managers["normalAction"];
|
const normalManager = managers.normalAction;
|
||||||
ok(
|
ok(
|
||||||
await normalManager.evalInSandbox("window.scriptRan"),
|
await normalManager.evalInSandbox("window.scriptRan"),
|
||||||
"Implementations are run in the sandbox",
|
"Implementations are run in the sandbox",
|
||||||
|
|
|
@ -408,7 +408,7 @@ this.TabCrashHandler = {
|
||||||
// default. In order to make sure we don't send it, we overwrite it
|
// default. In order to make sure we don't send it, we overwrite it
|
||||||
// with the empty string.
|
// with the empty string.
|
||||||
if (!includeURL) {
|
if (!includeURL) {
|
||||||
extraExtraKeyVals["URL"] = "";
|
extraExtraKeyVals.URL = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
CrashSubmit.submit(dumpID, {
|
CrashSubmit.submit(dumpID, {
|
||||||
|
|
|
@ -72,8 +72,8 @@ var DirectoryLinksProvider = {
|
||||||
get _linksURL() {
|
get _linksURL() {
|
||||||
if (!this.__linksURL) {
|
if (!this.__linksURL) {
|
||||||
try {
|
try {
|
||||||
this.__linksURL = Services.prefs.getCharPref(this._observedPrefs["linksURL"]);
|
this.__linksURL = Services.prefs.getCharPref(this._observedPrefs.linksURL);
|
||||||
this.__linksURLModified = Services.prefs.prefHasUserValue(this._observedPrefs["linksURL"]);
|
this.__linksURLModified = Services.prefs.prefHasUserValue(this._observedPrefs.linksURL);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Cu.reportError("Error fetching directory links url from prefs: " + e);
|
Cu.reportError("Error fetching directory links url from prefs: " + e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,7 +254,7 @@ this.OpenGraphBuilder = {
|
||||||
if (pageData.text)
|
if (pageData.text)
|
||||||
body += pageData.text + "\n\n";
|
body += pageData.text + "\n\n";
|
||||||
body += pageData.url;
|
body += pageData.url;
|
||||||
query["body"] = body;
|
query.body = body;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// if the url template doesn't have title and no text was provided, add the title as the text.
|
// if the url template doesn't have title and no text was provided, add the title as the text.
|
||||||
|
|
|
@ -485,7 +485,7 @@ this.SocialService = {
|
||||||
|
|
||||||
if (type == "directory" || type == "internal") {
|
if (type == "directory" || type == "internal") {
|
||||||
// directory provided manifests must have origin in manifest, use that
|
// directory provided manifests must have origin in manifest, use that
|
||||||
if (!data["origin"]) {
|
if (!data.origin) {
|
||||||
Cu.reportError("SocialService.manifestFromData directory service provided manifest without origin.");
|
Cu.reportError("SocialService.manifestFromData directory service provided manifest without origin.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ this.SocialService = {
|
||||||
Cu.reportError("SocialService.manifestFromData manifest missing required urls.");
|
Cu.reportError("SocialService.manifestFromData manifest missing required urls.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!data["name"] || !data["iconURL"]) {
|
if (!data.name || !data.iconURL) {
|
||||||
Cu.reportError("SocialService.manifestFromData manifest missing name or iconURL.");
|
Cu.reportError("SocialService.manifestFromData manifest missing name or iconURL.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,8 @@ function checkKeyedHistogram(h, key, expectedValue) {
|
||||||
*/
|
*/
|
||||||
function getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
|
function getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
|
||||||
const scalars = aKeyed ?
|
const scalars = aKeyed ?
|
||||||
Services.telemetry.snapshotKeyedScalars(aChannel, aClear)["parent"] :
|
Services.telemetry.snapshotKeyedScalars(aChannel, aClear).parent :
|
||||||
Services.telemetry.snapshotScalars(aChannel, aClear)["parent"];
|
Services.telemetry.snapshotScalars(aChannel, aClear).parent;
|
||||||
return scalars || {};
|
return scalars || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -437,8 +437,8 @@ add_task(async function test_DirectoryLinksProvider_getAllowedLinks() {
|
||||||
do_check_eq(links.length, 2);
|
do_check_eq(links.length, 2);
|
||||||
|
|
||||||
// The only remaining url should be http and https
|
// The only remaining url should be http and https
|
||||||
do_check_eq(links[0].url, data["directory"][1].url);
|
do_check_eq(links[0].url, data.directory[1].url);
|
||||||
do_check_eq(links[1].url, data["directory"][3].url);
|
do_check_eq(links[1].url, data.directory[3].url);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DirectoryLinksProvider_getAllowedImages() {
|
add_task(async function test_DirectoryLinksProvider_getAllowedImages() {
|
||||||
|
@ -458,8 +458,8 @@ add_task(async function test_DirectoryLinksProvider_getAllowedImages() {
|
||||||
do_check_eq(links.length, 2);
|
do_check_eq(links.length, 2);
|
||||||
|
|
||||||
// The only remaining images should be https and data
|
// The only remaining images should be https and data
|
||||||
do_check_eq(links[0].imageURI, data["directory"][3].imageURI);
|
do_check_eq(links[0].imageURI, data.directory[3].imageURI);
|
||||||
do_check_eq(links[1].imageURI, data["directory"][5].imageURI);
|
do_check_eq(links[1].imageURI, data.directory[5].imageURI);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DirectoryLinksProvider_getAllowedImages_base() {
|
add_task(async function test_DirectoryLinksProvider_getAllowedImages_base() {
|
||||||
|
@ -480,10 +480,10 @@ add_task(async function test_DirectoryLinksProvider_getAllowedImages_base() {
|
||||||
do_check_eq(links.length, 4);
|
do_check_eq(links.length, 4);
|
||||||
|
|
||||||
// The only remaining images should be https with mozilla.net or data URI
|
// The only remaining images should be https with mozilla.net or data URI
|
||||||
do_check_eq(links[0].url, data["directory"][1].url);
|
do_check_eq(links[0].url, data.directory[1].url);
|
||||||
do_check_eq(links[1].url, data["directory"][2].url);
|
do_check_eq(links[1].url, data.directory[2].url);
|
||||||
do_check_eq(links[2].url, data["directory"][3].url);
|
do_check_eq(links[2].url, data.directory[3].url);
|
||||||
do_check_eq(links[3].url, data["directory"][4].url);
|
do_check_eq(links[3].url, data.directory[4].url);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DirectoryLinksProvider_getAllowedEnhancedImages() {
|
add_task(async function test_DirectoryLinksProvider_getAllowedEnhancedImages() {
|
||||||
|
@ -503,8 +503,8 @@ add_task(async function test_DirectoryLinksProvider_getAllowedEnhancedImages() {
|
||||||
do_check_eq(links.length, 2);
|
do_check_eq(links.length, 2);
|
||||||
|
|
||||||
// The only remaining enhancedImages should be http and https and data
|
// The only remaining enhancedImages should be http and https and data
|
||||||
do_check_eq(links[0].enhancedImageURI, data["directory"][3].enhancedImageURI);
|
do_check_eq(links[0].enhancedImageURI, data.directory[3].enhancedImageURI);
|
||||||
do_check_eq(links[1].enhancedImageURI, data["directory"][5].enhancedImageURI);
|
do_check_eq(links[1].enhancedImageURI, data.directory[5].enhancedImageURI);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(function test_DirectoryLinksProvider_setDefaultEnhanced() {
|
add_task(function test_DirectoryLinksProvider_setDefaultEnhanced() {
|
||||||
|
|
|
@ -260,7 +260,7 @@ function run_test() {
|
||||||
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||||
checkValues(orig, t[1]);
|
checkValues(orig, t[1]);
|
||||||
let mod = orig;
|
let mod = orig;
|
||||||
mod["userContextId"] = 0;
|
mod.userContextId = 0;
|
||||||
checkValues(mod, t[2]);
|
checkValues(mod, t[2]);
|
||||||
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
||||||
});
|
});
|
||||||
|
@ -281,7 +281,7 @@ function run_test() {
|
||||||
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||||
checkValues(orig, t[1]);
|
checkValues(orig, t[1]);
|
||||||
let mod = orig;
|
let mod = orig;
|
||||||
mod["firstPartyDomain"] = "";
|
mod.firstPartyDomain = "";
|
||||||
checkValues(mod, t[2]);
|
checkValues(mod, t[2]);
|
||||||
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -818,7 +818,7 @@ function addSpecialMissingLanguageTags(availableLocales) {
|
||||||
|
|
||||||
// Also forcibly provide the last-ditch locale.
|
// Also forcibly provide the last-ditch locale.
|
||||||
var lastDitch = lastDitchLocale();
|
var lastDitch = lastDitchLocale();
|
||||||
assert(lastDitch === "en-GB" && availableLocales["en"],
|
assert(lastDitch === "en-GB" && availableLocales.en,
|
||||||
"shouldn't be a need to add every locale implied by the last-" +
|
"shouldn't be a need to add every locale implied by the last-" +
|
||||||
"ditch locale, merely just the last-ditch locale");
|
"ditch locale, merely just the last-ditch locale");
|
||||||
availableLocales[lastDitch] = true;
|
availableLocales[lastDitch] = true;
|
||||||
|
|
|
@ -38,7 +38,7 @@ var EmbedRT = {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
sandbox["console"] = new ConsoleAPI({ consoleID: "script/" + scriptURL });
|
sandbox.console = new ConsoleAPI({ consoleID: "script/" + scriptURL });
|
||||||
|
|
||||||
// As we don't want our caller to control the JS version used for the
|
// As we don't want our caller to control the JS version used for the
|
||||||
// script file, we run loadSubScript within the context of the
|
// script file, we run loadSubScript within the context of the
|
||||||
|
@ -55,7 +55,7 @@ var EmbedRT = {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sandbox["load"](params);
|
sandbox.load(params);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
dump("Exception calling 'load' method in script: " + scriptURL + "\n" + e);
|
dump("Exception calling 'load' method in script: " + scriptURL + "\n" + e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ var PermissionsHelper = {
|
||||||
}
|
}
|
||||||
// Get the strings that correspond to the permission type
|
// Get the strings that correspond to the permission type
|
||||||
let typeStrings = this._permissionStrings[type];
|
let typeStrings = this._permissionStrings[type];
|
||||||
let label = Strings.browser.GetStringFromName(typeStrings["label"]);
|
let label = Strings.browser.GetStringFromName(typeStrings.label);
|
||||||
|
|
||||||
// Get the key to look up the appropriate string entity
|
// Get the key to look up the appropriate string entity
|
||||||
let valueKey = value == Services.perms.ALLOW_ACTION ?
|
let valueKey = value == Services.perms.ALLOW_ACTION ?
|
||||||
|
@ -122,7 +122,7 @@ var PermissionsHelper = {
|
||||||
|
|
||||||
for (let i = 0; i < permissionsToClear.length; i++) {
|
for (let i = 0; i < permissionsToClear.length; i++) {
|
||||||
let indexToClear = permissionsToClear[i];
|
let indexToClear = permissionsToClear[i];
|
||||||
let permissionType = this._currentPermissions[indexToClear]["type"];
|
let permissionType = this._currentPermissions[indexToClear].type;
|
||||||
this.clearPermission(uri, permissionType, privacyContext);
|
this.clearPermission(uri, permissionType, privacyContext);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -79,7 +79,7 @@ var modules = {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (AppConstants.MOZ_SERVICES_HEALTHREPORT) {
|
if (AppConstants.MOZ_SERVICES_HEALTHREPORT) {
|
||||||
modules['healthreport'] = {
|
modules.healthreport = {
|
||||||
uri: "chrome://browser/content/aboutHealthReport.xhtml",
|
uri: "chrome://browser/content/aboutHealthReport.xhtml",
|
||||||
privileged: true
|
privileged: true
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@ BrowserCLH.prototype = {
|
||||||
* Consumers can access Android assets using resource://android/assets/FILENAME.
|
* Consumers can access Android assets using resource://android/assets/FILENAME.
|
||||||
*/
|
*/
|
||||||
setResourceSubstitutions: function () {
|
setResourceSubstitutions: function () {
|
||||||
let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci["nsIChromeRegistry"]);
|
let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
|
||||||
// Like jar:jar:file:///data/app/org.mozilla.fennec-2.apk!/assets/omni.ja!/chrome/chrome/content/aboutHome.xhtml
|
// Like jar:jar:file:///data/app/org.mozilla.fennec-2.apk!/assets/omni.ja!/chrome/chrome/content/aboutHome.xhtml
|
||||||
let url = registry.convertChromeURL(Services.io.newURI("chrome://browser/content/aboutHome.xhtml")).spec;
|
let url = registry.convertChromeURL(Services.io.newURI("chrome://browser/content/aboutHome.xhtml")).spec;
|
||||||
// Like jar:file:///data/app/org.mozilla.fennec-2.apk!/
|
// Like jar:file:///data/app/org.mozilla.fennec-2.apk!/
|
||||||
|
|
|
@ -205,8 +205,8 @@ LoginManagerPrompter.prototype = {
|
||||||
label: this._getLocalizedString("rememberButton"),
|
label: this._getLocalizedString("rememberButton"),
|
||||||
callback: function(checked, response) {
|
callback: function(checked, response) {
|
||||||
if (response) {
|
if (response) {
|
||||||
aLogin.username = response["username"] || aLogin.username;
|
aLogin.username = response.username || aLogin.username;
|
||||||
aLogin.password = response["password"] || aLogin.password;
|
aLogin.password = response.password || aLogin.password;
|
||||||
}
|
}
|
||||||
pwmgr.addLogin(aLogin);
|
pwmgr.addLogin(aLogin);
|
||||||
promptHistogram.add(PROMPT_ADD);
|
promptHistogram.add(PROMPT_ADD);
|
||||||
|
@ -265,7 +265,7 @@ LoginManagerPrompter.prototype = {
|
||||||
{
|
{
|
||||||
label: this._getLocalizedString("updateButton"),
|
label: this._getLocalizedString("updateButton"),
|
||||||
callback: function(checked, response) {
|
callback: function(checked, response) {
|
||||||
let password = response ? response["password"] : aNewPassword;
|
let password = response ? response.password : aNewPassword;
|
||||||
self._updateLogin(aOldLogin, password);
|
self._updateLogin(aOldLogin, password);
|
||||||
|
|
||||||
promptHistogram.add(PROMPT_UPDATE);
|
promptHistogram.add(PROMPT_UPDATE);
|
||||||
|
|
|
@ -98,12 +98,12 @@ this.FxAccountsWebChannel = function(options) {
|
||||||
if (!options) {
|
if (!options) {
|
||||||
throw new Error("Missing configuration options");
|
throw new Error("Missing configuration options");
|
||||||
}
|
}
|
||||||
if (!options["content_uri"]) {
|
if (!options.content_uri) {
|
||||||
throw new Error("Missing 'content_uri' option");
|
throw new Error("Missing 'content_uri' option");
|
||||||
}
|
}
|
||||||
this._contentUri = options.content_uri;
|
this._contentUri = options.content_uri;
|
||||||
|
|
||||||
if (!options["channel_id"]) {
|
if (!options.channel_id) {
|
||||||
throw new Error("Missing 'channel_id' option");
|
throw new Error("Missing 'channel_id' option");
|
||||||
}
|
}
|
||||||
this._webChannelId = options.channel_id;
|
this._webChannelId = options.channel_id;
|
||||||
|
|
|
@ -25,7 +25,7 @@ function resolveGeckoURI(aURI) {
|
||||||
throw "Can't resolve an empty uri";
|
throw "Can't resolve an empty uri";
|
||||||
|
|
||||||
if (aURI.startsWith("chrome://")) {
|
if (aURI.startsWith("chrome://")) {
|
||||||
let registry = Cc['@mozilla.org/chrome/chrome-registry;1'].getService(Ci["nsIChromeRegistry"]);
|
let registry = Cc['@mozilla.org/chrome/chrome-registry;1'].getService(Ci.nsIChromeRegistry);
|
||||||
return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
|
return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
|
||||||
} else if (aURI.startsWith("resource://")) {
|
} else if (aURI.startsWith("resource://")) {
|
||||||
let handler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
|
let handler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
|
||||||
|
|
|
@ -1020,7 +1020,7 @@ function JNILoadClass(jenv, classSig, opt_props) {
|
||||||
rpp.setElements = function(start, vals) {
|
rpp.setElements = function(start, vals) {
|
||||||
vals.forEach((v, i) => { this.set(start+i, v); });
|
vals.forEach((v, i) => { this.set(start+i, v); });
|
||||||
};
|
};
|
||||||
r['new'] = function(length) {
|
r.new = function(length) {
|
||||||
return wrap(jenvpp().NewObjectArray(jenv, length, elemClass, null),
|
return wrap(jenvpp().NewObjectArray(jenv, length, elemClass, null),
|
||||||
classSig);
|
classSig);
|
||||||
};
|
};
|
||||||
|
@ -1042,7 +1042,7 @@ function JNILoadClass(jenv, classSig, opt_props) {
|
||||||
j[setter].call(j, jenv, unwrap(this), start, vals.length,
|
j[setter].call(j, jenv, unwrap(this), start, vals.length,
|
||||||
ctype.array()(vals));
|
ctype.array()(vals));
|
||||||
};
|
};
|
||||||
r['new'] = function(length) {
|
r.new = function(length) {
|
||||||
var j = jenvpp();
|
var j = jenvpp();
|
||||||
return wrap(j[constructor].call(j, jenv, length), classSig);
|
return wrap(j[constructor].call(j, jenv, length), classSig);
|
||||||
};
|
};
|
||||||
|
@ -1093,7 +1093,7 @@ function JNILoadClass(jenv, classSig, opt_props) {
|
||||||
var argctypes = mtd.sig.match(sigRegex()).map(s => sig2ctype(s));
|
var argctypes = mtd.sig.match(sigRegex()).map(s => sig2ctype(s));
|
||||||
var returnSig = mtd.sig.substring(mtd.sig.indexOf(')')+1);
|
var returnSig = mtd.sig.substring(mtd.sig.indexOf(')')+1);
|
||||||
|
|
||||||
r['new'] = overloadFunc('new');
|
r.new = overloadFunc('new');
|
||||||
r['new'+mtd.sig] = r['new('+(argctypes.length-1)+')'] = function() {
|
r['new'+mtd.sig] = r['new('+(argctypes.length-1)+')'] = function() {
|
||||||
var i, j = jenvpp();
|
var i, j = jenvpp();
|
||||||
var args = [jenv, jcls, jmtd];
|
var args = [jenv, jcls, jmtd];
|
||||||
|
|
|
@ -22,7 +22,7 @@ function resolveGeckoURI(aURI) {
|
||||||
throw "Can't resolve an empty uri";
|
throw "Can't resolve an empty uri";
|
||||||
|
|
||||||
if (aURI.startsWith("chrome://")) {
|
if (aURI.startsWith("chrome://")) {
|
||||||
let registry = Cc['@mozilla.org/chrome/chrome-registry;1'].getService(Ci["nsIChromeRegistry"]);
|
let registry = Cc['@mozilla.org/chrome/chrome-registry;1'].getService(Ci.nsIChromeRegistry);
|
||||||
return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
|
return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
|
||||||
} else if (aURI.startsWith("resource://")) {
|
} else if (aURI.startsWith("resource://")) {
|
||||||
let handler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
|
let handler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
|
||||||
|
|
|
@ -21,9 +21,9 @@ var WebsiteMetadata = {
|
||||||
parseAsynchronously: function(doc) {
|
parseAsynchronously: function(doc) {
|
||||||
Task.spawn(function() {
|
Task.spawn(function() {
|
||||||
let metadata = getMetadata(doc, doc.location.href, {
|
let metadata = getMetadata(doc, doc.location.href, {
|
||||||
image_url: metadataRules['image_url'],
|
image_url: metadataRules.image_url,
|
||||||
provider: metadataRules['provider'],
|
provider: metadataRules.provider,
|
||||||
description_length: metadataRules['description_length']
|
description_length: metadataRules.description_length
|
||||||
});
|
});
|
||||||
|
|
||||||
// No metadata was extracted, so don't bother sending it.
|
// No metadata was extracted, so don't bother sending it.
|
||||||
|
|
|
@ -17,9 +17,6 @@ module.exports = {
|
||||||
// Require default case in switch statements.
|
// Require default case in switch statements.
|
||||||
"default-case": "error",
|
"default-case": "error",
|
||||||
|
|
||||||
// Require `foo.bar` dot notation instead of `foo["bar"]` notation.
|
|
||||||
"dot-notation": "error",
|
|
||||||
|
|
||||||
// Require function* name()
|
// Require function* name()
|
||||||
"generator-star-spacing": ["error", {"before": false, "after": true}],
|
"generator-star-spacing": ["error", {"before": false, "after": true}],
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ this.HawkClient.prototype = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self._updateClockOffset(restResponse.headers["date"]);
|
self._updateClockOffset(restResponse.headers.date);
|
||||||
|
|
||||||
if (status === 401 && retryOK && !("retry-after" in restResponse.headers)) {
|
if (status === 401 && retryOK && !("retry-after" in restResponse.headers)) {
|
||||||
// Retry once if we were rejected due to a bad timestamp.
|
// Retry once if we were rejected due to a bad timestamp.
|
||||||
|
|
|
@ -557,7 +557,7 @@ add_test(function test_get_storage_405() {
|
||||||
let error = doGetRequest(request);
|
let error = doGetRequest(request);
|
||||||
do_check_eq(error, null);
|
do_check_eq(error, null);
|
||||||
do_check_eq(request.response.status, 405);
|
do_check_eq(request.response.status, 405);
|
||||||
do_check_eq(request.response.headers["allow"], "DELETE");
|
do_check_eq(request.response.headers.allow, "DELETE");
|
||||||
|
|
||||||
server.stop(run_next_test);
|
server.stop(run_next_test);
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,7 @@ TokenServerClientError.prototype.toString = function() {
|
||||||
}
|
}
|
||||||
TokenServerClientError.prototype.toJSON = function() {
|
TokenServerClientError.prototype.toJSON = function() {
|
||||||
let result = this._toStringFields();
|
let result = this._toStringFields();
|
||||||
result["name"] = this.name;
|
result.name = this.name;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ this.FxAccountsProfileClient.prototype = {
|
||||||
if (request.response.success) {
|
if (request.response.success) {
|
||||||
resolve({
|
resolve({
|
||||||
body,
|
body,
|
||||||
etag: request.response.headers["etag"]
|
etag: request.response.headers.etag
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,12 +82,12 @@ this.FxAccountsWebChannel = function(options) {
|
||||||
if (!options) {
|
if (!options) {
|
||||||
throw new Error("Missing configuration options");
|
throw new Error("Missing configuration options");
|
||||||
}
|
}
|
||||||
if (!options["content_uri"]) {
|
if (!options.content_uri) {
|
||||||
throw new Error("Missing 'content_uri' option");
|
throw new Error("Missing 'content_uri' option");
|
||||||
}
|
}
|
||||||
this._contentUri = options.content_uri;
|
this._contentUri = options.content_uri;
|
||||||
|
|
||||||
if (!options["channel_id"]) {
|
if (!options.channel_id) {
|
||||||
throw new Error("Missing 'channel_id' option");
|
throw new Error("Missing 'channel_id' option");
|
||||||
}
|
}
|
||||||
this._webChannelId = options.channel_id;
|
this._webChannelId = options.channel_id;
|
||||||
|
|
|
@ -48,13 +48,13 @@ function getEngineModules() {
|
||||||
ExtensionStorage: {module: "extension-storage.js", symbol: "ExtensionStorageEngine"},
|
ExtensionStorage: {module: "extension-storage.js", symbol: "ExtensionStorageEngine"},
|
||||||
}
|
}
|
||||||
if (Svc.Prefs.get("engine.addresses.available", false)) {
|
if (Svc.Prefs.get("engine.addresses.available", false)) {
|
||||||
result["Addresses"] = {
|
result.Addresses = {
|
||||||
module: "resource://formautofill/FormAutofillSync.jsm",
|
module: "resource://formautofill/FormAutofillSync.jsm",
|
||||||
symbol: "AddressesEngine",
|
symbol: "AddressesEngine",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (Svc.Prefs.get("engine.creditcards.available", false)) {
|
if (Svc.Prefs.get("engine.creditcards.available", false)) {
|
||||||
result["CreditCards"] = {
|
result.CreditCards = {
|
||||||
module: "resource://formautofill/FormAutofillSync.jsm",
|
module: "resource://formautofill/FormAutofillSync.jsm",
|
||||||
symbol: "CreditCardsEngine",
|
symbol: "CreditCardsEngine",
|
||||||
};
|
};
|
||||||
|
|
|
@ -445,7 +445,7 @@ class SyncTelemetryImpl {
|
||||||
|
|
||||||
getPingJSON(reason) {
|
getPingJSON(reason) {
|
||||||
return {
|
return {
|
||||||
os: TelemetryEnvironment.currentEnvironment["system"]["os"],
|
os: TelemetryEnvironment.currentEnvironment.system.os,
|
||||||
why: reason,
|
why: reason,
|
||||||
discarded: this.discarded || undefined,
|
discarded: this.discarded || undefined,
|
||||||
version: PING_FORMAT_VERSION,
|
version: PING_FORMAT_VERSION,
|
||||||
|
|
|
@ -152,7 +152,7 @@ add_task(async function test_get_changed_ids() {
|
||||||
scope: 0,
|
scope: 0,
|
||||||
foreignInstall: false
|
foreignInstall: false
|
||||||
};
|
};
|
||||||
reconciler.addons["DUMMY"] = record;
|
reconciler.addons.DUMMY = record;
|
||||||
reconciler._addChange(record.modified, CHANGE_INSTALLED, record);
|
reconciler._addChange(record.modified, CHANGE_INSTALLED, record);
|
||||||
|
|
||||||
changes = await engine.getChangedIDs();
|
changes = await engine.getChangedIDs();
|
||||||
|
|
|
@ -61,10 +61,10 @@ add_task(async function testOldMeta() {
|
||||||
let engineSync = new EngineSynchronizer(Service);
|
let engineSync = new EngineSynchronizer(Service);
|
||||||
await engineSync._updateEnabledFromMeta(meta, 3, manager);
|
await engineSync._updateEnabledFromMeta(meta, 3, manager);
|
||||||
|
|
||||||
Assert.ok(manager._engines["petrol"].enabled, "'petrol' locally enabled.");
|
Assert.ok(manager._engines.petrol.enabled, "'petrol' locally enabled.");
|
||||||
Assert.ok(manager._engines["diesel"].enabled, "'diesel' locally enabled.");
|
Assert.ok(manager._engines.diesel.enabled, "'diesel' locally enabled.");
|
||||||
Assert.ok(!("nonlocal" in manager._engines), "We don't know anything about the 'nonlocal' engine.");
|
Assert.ok(!("nonlocal" in manager._engines), "We don't know anything about the 'nonlocal' engine.");
|
||||||
Assert.ok(!manager._engines["actual"].enabled, "'actual' not locally enabled.");
|
Assert.ok(!manager._engines.actual.enabled, "'actual' not locally enabled.");
|
||||||
Assert.ok(!manager.isDeclined("actual"), "'actual' not declined, though.");
|
Assert.ok(!manager.isDeclined("actual"), "'actual' not declined, though.");
|
||||||
|
|
||||||
let declinedEngines = new DeclinedEngines(Service);
|
let declinedEngines = new DeclinedEngines(Service);
|
||||||
|
@ -107,10 +107,10 @@ add_task(async function testDeclinedMeta() {
|
||||||
_("Record: " + JSON.stringify(meta));
|
_("Record: " + JSON.stringify(meta));
|
||||||
|
|
||||||
let manager = getEngineManager();
|
let manager = getEngineManager();
|
||||||
manager._engines["petrol"].enabled = true;
|
manager._engines.petrol.enabled = true;
|
||||||
manager._engines["diesel"].enabled = true;
|
manager._engines.diesel.enabled = true;
|
||||||
manager._engines["dummy"].enabled = true;
|
manager._engines.dummy.enabled = true;
|
||||||
manager._engines["actual"].enabled = false; // Disabled but not declined.
|
manager._engines.actual.enabled = false; // Disabled but not declined.
|
||||||
|
|
||||||
manager.decline(["localdecline"]); // Declined and not supported.
|
manager.decline(["localdecline"]); // Declined and not supported.
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ add_task(async function test_disabled_no_track() {
|
||||||
do_check_empty(tracker.changedIDs);
|
do_check_empty(tracker.changedIDs);
|
||||||
|
|
||||||
tracker.addChangedID("abcdefghijkl");
|
tracker.addChangedID("abcdefghijkl");
|
||||||
do_check_true(0 < tracker.changedIDs["abcdefghijkl"]);
|
do_check_true(0 < tracker.changedIDs.abcdefghijkl);
|
||||||
Svc.Prefs.set("engine." + engine.prefName, false);
|
Svc.Prefs.set("engine." + engine.prefName, false);
|
||||||
do_check_false(tracker._isTracking);
|
do_check_false(tracker._isTracking);
|
||||||
do_check_empty(tracker.changedIDs);
|
do_check_empty(tracker.changedIDs);
|
||||||
|
|
|
@ -824,7 +824,7 @@ add_task(async function test_sync_engine_generic_fail() {
|
||||||
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||||
|
|
||||||
do_check_eq(Status.engines["catapult"], undefined);
|
do_check_eq(Status.engines.catapult, undefined);
|
||||||
|
|
||||||
let promiseObserved = new Promise(res => {
|
let promiseObserved = new Promise(res => {
|
||||||
Svc.Obs.add("weave:engine:sync:finish", function onEngineFinish() {
|
Svc.Obs.add("weave:engine:sync:finish", function onEngineFinish() {
|
||||||
|
@ -846,7 +846,7 @@ add_task(async function test_sync_engine_generic_fail() {
|
||||||
await promiseObserved;
|
await promiseObserved;
|
||||||
|
|
||||||
_("Status.engines: " + JSON.stringify(Status.engines));
|
_("Status.engines: " + JSON.stringify(Status.engines));
|
||||||
do_check_eq(Status.engines["catapult"], ENGINE_UNKNOWN_FAIL);
|
do_check_eq(Status.engines.catapult, ENGINE_UNKNOWN_FAIL);
|
||||||
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
||||||
|
|
||||||
// Test Error log was written on SYNC_FAILED_PARTIAL.
|
// Test Error log was written on SYNC_FAILED_PARTIAL.
|
||||||
|
@ -935,12 +935,12 @@ add_task(async function test_engine_applyFailed() {
|
||||||
|
|
||||||
let promiseObserved = promiseOneObserver("weave:service:reset-file-log");
|
let promiseObserved = promiseOneObserver("weave:service:reset-file-log");
|
||||||
|
|
||||||
do_check_eq(Status.engines["catapult"], undefined);
|
do_check_eq(Status.engines.catapult, undefined);
|
||||||
do_check_true(await EHTestsCommon.setUp(server));
|
do_check_true(await EHTestsCommon.setUp(server));
|
||||||
await Service.sync();
|
await Service.sync();
|
||||||
await promiseObserved;
|
await promiseObserved;
|
||||||
|
|
||||||
do_check_eq(Status.engines["catapult"], ENGINE_APPLY_FAIL);
|
do_check_eq(Status.engines.catapult, ENGINE_APPLY_FAIL);
|
||||||
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
||||||
|
|
||||||
// Test Error log was written on SYNC_FAILED_PARTIAL.
|
// Test Error log was written on SYNC_FAILED_PARTIAL.
|
||||||
|
|
|
@ -225,7 +225,7 @@ add_test(function test_storage_request() {
|
||||||
_("Modified is " + this.response.newModified);
|
_("Modified is " + this.response.newModified);
|
||||||
let parsedBody = JSON.parse(this.response.body);
|
let parsedBody = JSON.parse(this.response.body);
|
||||||
do_check_true(parsedBody >= now);
|
do_check_true(parsedBody >= now);
|
||||||
do_check_empty(server.users["john"].collections);
|
do_check_empty(server.users.john.collections);
|
||||||
Utils.nextTick(next);
|
Utils.nextTick(next);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ add_test(function test_storage_request() {
|
||||||
let req = localRequest(server, storageURL);
|
let req = localRequest(server, storageURL);
|
||||||
req.get(function(err) {
|
req.get(function(err) {
|
||||||
do_check_eq(this.response.status, 405);
|
do_check_eq(this.response.status, 405);
|
||||||
do_check_eq(this.response.headers["allow"], "DELETE");
|
do_check_eq(this.response.headers.allow, "DELETE");
|
||||||
Utils.nextTick(next);
|
Utils.nextTick(next);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,9 +215,9 @@ add_task(async function test_ensureLoggedIn() {
|
||||||
*/
|
*/
|
||||||
let info_collections = {};
|
let info_collections = {};
|
||||||
do_check_true(collectionKeys.updateNeeded(info_collections));
|
do_check_true(collectionKeys.updateNeeded(info_collections));
|
||||||
info_collections["crypto"] = 5000;
|
info_collections.crypto = 5000;
|
||||||
do_check_false(collectionKeys.updateNeeded(info_collections));
|
do_check_false(collectionKeys.updateNeeded(info_collections));
|
||||||
info_collections["crypto"] = 1 + (Date.now() / 1000); // Add one in case computers are fast!
|
info_collections.crypto = 1 + (Date.now() / 1000); // Add one in case computers are fast!
|
||||||
do_check_true(collectionKeys.updateNeeded(info_collections));
|
do_check_true(collectionKeys.updateNeeded(info_collections));
|
||||||
|
|
||||||
collectionKeys.lastModified = null;
|
collectionKeys.lastModified = null;
|
||||||
|
|
|
@ -293,8 +293,8 @@ add_test(function test_basicauth() {
|
||||||
_("Test that the BasicAuthenticator doesn't screw up header case.");
|
_("Test that the BasicAuthenticator doesn't screw up header case.");
|
||||||
let res1 = new AsyncResource(server.baseURI + "/foo");
|
let res1 = new AsyncResource(server.baseURI + "/foo");
|
||||||
res1.setHeader("Authorization", "Basic foobar");
|
res1.setHeader("Authorization", "Basic foobar");
|
||||||
do_check_eq(res1._headers["authorization"], "Basic foobar");
|
do_check_eq(res1._headers.authorization, "Basic foobar");
|
||||||
do_check_eq(res1.headers["authorization"], "Basic foobar");
|
do_check_eq(res1.headers.authorization, "Basic foobar");
|
||||||
|
|
||||||
run_next_test();
|
run_next_test();
|
||||||
});
|
});
|
||||||
|
|
|
@ -311,12 +311,12 @@ add_task(async function test_disabledRemotelyTwoClients() {
|
||||||
|
|
||||||
_("Disable engine by deleting from meta/global.");
|
_("Disable engine by deleting from meta/global.");
|
||||||
let d = metaWBO.data;
|
let d = metaWBO.data;
|
||||||
delete d.engines["steam"];
|
delete d.engines.steam;
|
||||||
metaWBO.payload = JSON.stringify(d);
|
metaWBO.payload = JSON.stringify(d);
|
||||||
metaWBO.modified = Date.now() / 1000;
|
metaWBO.modified = Date.now() / 1000;
|
||||||
|
|
||||||
_("Add a second client and verify that the local pref is changed.");
|
_("Add a second client and verify that the local pref is changed.");
|
||||||
Service.clientsEngine._store._remoteClients["foobar"] = {name: "foobar", type: "desktop"};
|
Service.clientsEngine._store._remoteClients.foobar = {name: "foobar", type: "desktop"};
|
||||||
await Service.sync();
|
await Service.sync();
|
||||||
|
|
||||||
_("Engine is disabled.");
|
_("Engine is disabled.");
|
||||||
|
|
|
@ -51,18 +51,18 @@ function run_test() {
|
||||||
|
|
||||||
// Check engine status
|
// Check engine status
|
||||||
Status.engines = ["testEng1", ENGINE_SUCCEEDED];
|
Status.engines = ["testEng1", ENGINE_SUCCEEDED];
|
||||||
do_check_eq(Status.engines["testEng1"], ENGINE_SUCCEEDED);
|
do_check_eq(Status.engines.testEng1, ENGINE_SUCCEEDED);
|
||||||
do_check_eq(Status.service, STATUS_OK);
|
do_check_eq(Status.service, STATUS_OK);
|
||||||
|
|
||||||
Status.engines = ["testEng2", ENGINE_DOWNLOAD_FAIL];
|
Status.engines = ["testEng2", ENGINE_DOWNLOAD_FAIL];
|
||||||
do_check_eq(Status.engines["testEng1"], ENGINE_SUCCEEDED);
|
do_check_eq(Status.engines.testEng1, ENGINE_SUCCEEDED);
|
||||||
do_check_eq(Status.engines["testEng2"], ENGINE_DOWNLOAD_FAIL);
|
do_check_eq(Status.engines.testEng2, ENGINE_DOWNLOAD_FAIL);
|
||||||
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
||||||
|
|
||||||
Status.engines = ["testEng3", ENGINE_SUCCEEDED];
|
Status.engines = ["testEng3", ENGINE_SUCCEEDED];
|
||||||
do_check_eq(Status.engines["testEng1"], ENGINE_SUCCEEDED);
|
do_check_eq(Status.engines.testEng1, ENGINE_SUCCEEDED);
|
||||||
do_check_eq(Status.engines["testEng2"], ENGINE_DOWNLOAD_FAIL);
|
do_check_eq(Status.engines.testEng2, ENGINE_DOWNLOAD_FAIL);
|
||||||
do_check_eq(Status.engines["testEng3"], ENGINE_SUCCEEDED);
|
do_check_eq(Status.engines.testEng3, ENGINE_SUCCEEDED);
|
||||||
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ add_task(async function test_syncStartup_emptyOrOutdatedGlobalsResetsSync() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Confirm initial environment
|
// Confirm initial environment
|
||||||
do_check_eq(engine._tracker.changedIDs["rekolok"], undefined);
|
do_check_eq(engine._tracker.changedIDs.rekolok, undefined);
|
||||||
let metaGlobal = await Service.recordManager.get(engine.metaURL);
|
let metaGlobal = await Service.recordManager.get(engine.metaURL);
|
||||||
do_check_eq(metaGlobal.payload.engines, undefined);
|
do_check_eq(metaGlobal.payload.engines, undefined);
|
||||||
do_check_true(!!collection.payload("flying"));
|
do_check_true(!!collection.payload("flying"));
|
||||||
|
@ -113,7 +113,7 @@ add_task(async function test_syncStartup_emptyOrOutdatedGlobalsResetsSync() {
|
||||||
await engine._syncStartup();
|
await engine._syncStartup();
|
||||||
|
|
||||||
// The meta/global WBO has been filled with data about the engine
|
// The meta/global WBO has been filled with data about the engine
|
||||||
let engineData = metaGlobal.payload.engines["rotary"];
|
let engineData = metaGlobal.payload.engines.rotary;
|
||||||
do_check_eq(engineData.version, engine.version);
|
do_check_eq(engineData.version, engine.version);
|
||||||
do_check_eq(engineData.syncID, engine.syncID);
|
do_check_eq(engineData.syncID, engine.syncID);
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ add_task(async function test_syncStartup_syncIDMismatchResetsClient() {
|
||||||
|
|
||||||
// Confirm initial environment
|
// Confirm initial environment
|
||||||
do_check_eq(engine.syncID, "fake-guid-00");
|
do_check_eq(engine.syncID, "fake-guid-00");
|
||||||
do_check_eq(engine._tracker.changedIDs["rekolok"], undefined);
|
do_check_eq(engine._tracker.changedIDs.rekolok, undefined);
|
||||||
|
|
||||||
engine.lastSync = Date.now() / 1000;
|
engine.lastSync = Date.now() / 1000;
|
||||||
engine.lastSyncLocal = Date.now();
|
engine.lastSyncLocal = Date.now();
|
||||||
|
@ -349,7 +349,7 @@ add_task(async function test_processIncoming_reconcile() {
|
||||||
do_check_eq(engine._store.items.olderidentical, "Older but identical");
|
do_check_eq(engine._store.items.olderidentical, "Older but identical");
|
||||||
do_check_eq(engine._store.items.updateclient, "Got data?");
|
do_check_eq(engine._store.items.updateclient, "Got data?");
|
||||||
do_check_eq(engine._store.items.nukeme, "Nuke me!");
|
do_check_eq(engine._store.items.nukeme, "Nuke me!");
|
||||||
do_check_true(engine._tracker.changedIDs["olderidentical"] > 0);
|
do_check_true(engine._tracker.changedIDs.olderidentical > 0);
|
||||||
|
|
||||||
await engine._syncStartup();
|
await engine._syncStartup();
|
||||||
await engine._processIncoming();
|
await engine._processIncoming();
|
||||||
|
@ -367,7 +367,7 @@ add_task(async function test_processIncoming_reconcile() {
|
||||||
// The data for 'olderidentical' is identical on the server, so
|
// The data for 'olderidentical' is identical on the server, so
|
||||||
// it's no longer marked as changed anymore.
|
// it's no longer marked as changed anymore.
|
||||||
do_check_eq(engine._store.items.olderidentical, "Older but identical");
|
do_check_eq(engine._store.items.olderidentical, "Older but identical");
|
||||||
do_check_eq(engine._tracker.changedIDs["olderidentical"], undefined);
|
do_check_eq(engine._tracker.changedIDs.olderidentical, undefined);
|
||||||
|
|
||||||
// Updated with server data.
|
// Updated with server data.
|
||||||
do_check_eq(engine._store.items.updateclient, "Get this!");
|
do_check_eq(engine._store.items.updateclient, "Get this!");
|
||||||
|
@ -1195,7 +1195,7 @@ add_task(async function test_uploadOutgoing_toEmptyServer() {
|
||||||
do_check_true(!!collection.payload("scotsman"));
|
do_check_true(!!collection.payload("scotsman"));
|
||||||
do_check_eq(JSON.parse(collection.wbo("scotsman").data.ciphertext).id,
|
do_check_eq(JSON.parse(collection.wbo("scotsman").data.ciphertext).id,
|
||||||
"scotsman");
|
"scotsman");
|
||||||
do_check_eq(engine._tracker.changedIDs["scotsman"], undefined);
|
do_check_eq(engine._tracker.changedIDs.scotsman, undefined);
|
||||||
|
|
||||||
// The 'flying' record wasn't marked so it wasn't uploaded
|
// The 'flying' record wasn't marked so it wasn't uploaded
|
||||||
do_check_eq(collection.payload("flying"), undefined);
|
do_check_eq(collection.payload("flying"), undefined);
|
||||||
|
@ -1251,7 +1251,7 @@ async function test_uploadOutgoing_max_record_payload_bytes(allowSkippedRecord)
|
||||||
// Check we uploaded the other record to the server
|
// Check we uploaded the other record to the server
|
||||||
do_check_true(collection.payload("scotsman"));
|
do_check_true(collection.payload("scotsman"));
|
||||||
// And that we won't try to upload the huge record next time.
|
// And that we won't try to upload the huge record next time.
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], undefined);
|
do_check_eq(engine._tracker.changedIDs.flying, undefined);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (allowSkippedRecord) {
|
if (allowSkippedRecord) {
|
||||||
|
@ -1261,7 +1261,7 @@ async function test_uploadOutgoing_max_record_payload_bytes(allowSkippedRecord)
|
||||||
await engine.trackRemainingChanges();
|
await engine.trackRemainingChanges();
|
||||||
|
|
||||||
// Check that we will try to upload the huge record next time
|
// Check that we will try to upload the huge record next time
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], 1000);
|
do_check_eq(engine._tracker.changedIDs.flying, 1000);
|
||||||
} finally {
|
} finally {
|
||||||
// Check we didn't upload the oversized record to the server
|
// Check we didn't upload the oversized record to the server
|
||||||
do_check_eq(collection.payload("flying"), undefined);
|
do_check_eq(collection.payload("flying"), undefined);
|
||||||
|
@ -1317,9 +1317,9 @@ add_task(async function test_uploadOutgoing_failed() {
|
||||||
// Confirm initial environment
|
// Confirm initial environment
|
||||||
do_check_eq(engine.lastSyncLocal, 0);
|
do_check_eq(engine.lastSyncLocal, 0);
|
||||||
do_check_eq(collection.payload("flying"), undefined);
|
do_check_eq(collection.payload("flying"), undefined);
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], FLYING_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.flying, FLYING_CHANGED);
|
||||||
do_check_eq(engine._tracker.changedIDs["scotsman"], SCOTSMAN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.scotsman, SCOTSMAN_CHANGED);
|
||||||
do_check_eq(engine._tracker.changedIDs["peppercorn"], PEPPERCORN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.peppercorn, PEPPERCORN_CHANGED);
|
||||||
|
|
||||||
engine.enabled = true;
|
engine.enabled = true;
|
||||||
await sync_engine_and_validate_telem(engine, true);
|
await sync_engine_and_validate_telem(engine, true);
|
||||||
|
@ -1329,12 +1329,12 @@ add_task(async function test_uploadOutgoing_failed() {
|
||||||
|
|
||||||
// Ensure the 'flying' record has been uploaded and is no longer marked.
|
// Ensure the 'flying' record has been uploaded and is no longer marked.
|
||||||
do_check_true(!!collection.payload("flying"));
|
do_check_true(!!collection.payload("flying"));
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], undefined);
|
do_check_eq(engine._tracker.changedIDs.flying, undefined);
|
||||||
|
|
||||||
// The 'scotsman' and 'peppercorn' records couldn't be uploaded so
|
// The 'scotsman' and 'peppercorn' records couldn't be uploaded so
|
||||||
// they weren't cleared from the tracker.
|
// they weren't cleared from the tracker.
|
||||||
do_check_eq(engine._tracker.changedIDs["scotsman"], SCOTSMAN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.scotsman, SCOTSMAN_CHANGED);
|
||||||
do_check_eq(engine._tracker.changedIDs["peppercorn"], PEPPERCORN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.peppercorn, PEPPERCORN_CHANGED);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
await promiseClean(engine, server);
|
await promiseClean(engine, server);
|
||||||
|
@ -1448,8 +1448,8 @@ async function createRecordFailTelemetry(allowSkippedRecord) {
|
||||||
// Confirm initial environment
|
// Confirm initial environment
|
||||||
do_check_eq(engine.lastSyncLocal, 0);
|
do_check_eq(engine.lastSyncLocal, 0);
|
||||||
do_check_eq(collection.payload("flying"), undefined);
|
do_check_eq(collection.payload("flying"), undefined);
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], FLYING_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.flying, FLYING_CHANGED);
|
||||||
do_check_eq(engine._tracker.changedIDs["scotsman"], SCOTSMAN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.scotsman, SCOTSMAN_CHANGED);
|
||||||
|
|
||||||
engine.enabled = true;
|
engine.enabled = true;
|
||||||
ping = await sync_engine_and_validate_telem(engine, true, onErrorPing => {
|
ping = await sync_engine_and_validate_telem(engine, true, onErrorPing => {
|
||||||
|
@ -1462,7 +1462,7 @@ async function createRecordFailTelemetry(allowSkippedRecord) {
|
||||||
|
|
||||||
// Ensure the 'flying' record has been uploaded and is no longer marked.
|
// Ensure the 'flying' record has been uploaded and is no longer marked.
|
||||||
do_check_true(!!collection.payload("flying"));
|
do_check_true(!!collection.payload("flying"));
|
||||||
do_check_eq(engine._tracker.changedIDs["flying"], undefined);
|
do_check_eq(engine._tracker.changedIDs.flying, undefined);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (allowSkippedRecord) {
|
if (allowSkippedRecord) {
|
||||||
do_throw("should not get here");
|
do_throw("should not get here");
|
||||||
|
@ -1470,7 +1470,7 @@ async function createRecordFailTelemetry(allowSkippedRecord) {
|
||||||
|
|
||||||
// Ensure the 'flying' record has not been uploaded and is still marked
|
// Ensure the 'flying' record has not been uploaded and is still marked
|
||||||
do_check_false(collection.payload("flying"));
|
do_check_false(collection.payload("flying"));
|
||||||
do_check_true(engine._tracker.changedIDs["flying"]);
|
do_check_true(engine._tracker.changedIDs.flying);
|
||||||
} finally {
|
} finally {
|
||||||
// Local timestamp has been set.
|
// Local timestamp has been set.
|
||||||
do_check_true(engine.lastSyncLocal > 0);
|
do_check_true(engine.lastSyncLocal > 0);
|
||||||
|
@ -1481,7 +1481,7 @@ async function createRecordFailTelemetry(allowSkippedRecord) {
|
||||||
// In any case, the 'scotsman' record couldn't be created so it wasn't
|
// In any case, the 'scotsman' record couldn't be created so it wasn't
|
||||||
// uploaded nor it was not cleared from the tracker.
|
// uploaded nor it was not cleared from the tracker.
|
||||||
do_check_false(collection.payload("scotsman"));
|
do_check_false(collection.payload("scotsman"));
|
||||||
do_check_eq(engine._tracker.changedIDs["scotsman"], SCOTSMAN_CHANGED);
|
do_check_eq(engine._tracker.changedIDs.scotsman, SCOTSMAN_CHANGED);
|
||||||
|
|
||||||
engine._store.createRecord = oldCreateRecord;
|
engine._store.createRecord = oldCreateRecord;
|
||||||
await promiseClean(engine, server);
|
await promiseClean(engine, server);
|
||||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function test_create() {
|
||||||
cleartext: { "foo": "bar" },
|
cleartext: { "foo": "bar" },
|
||||||
modified: 1000};
|
modified: 1000};
|
||||||
await store.applyIncoming(rec);
|
await store.applyIncoming(rec);
|
||||||
deepEqual(store._remoteClients["id1"], { lastModified: 1000, foo: "bar" });
|
deepEqual(store._remoteClients.id1, { lastModified: 1000, foo: "bar" });
|
||||||
|
|
||||||
_("Create a second record");
|
_("Create a second record");
|
||||||
rec = {id: "id2",
|
rec = {id: "id2",
|
||||||
|
@ -34,7 +34,7 @@ add_task(async function test_create() {
|
||||||
cleartext: { "foo2": "bar2" },
|
cleartext: { "foo2": "bar2" },
|
||||||
modified: 2000};
|
modified: 2000};
|
||||||
await store.applyIncoming(rec);
|
await store.applyIncoming(rec);
|
||||||
deepEqual(store._remoteClients["id2"], { lastModified: 2000, foo2: "bar2" });
|
deepEqual(store._remoteClients.id2, { lastModified: 2000, foo2: "bar2" });
|
||||||
|
|
||||||
_("Create a third record");
|
_("Create a third record");
|
||||||
rec = {id: "id3",
|
rec = {id: "id3",
|
||||||
|
@ -42,7 +42,7 @@ add_task(async function test_create() {
|
||||||
cleartext: { "foo3": "bar3" },
|
cleartext: { "foo3": "bar3" },
|
||||||
modified: 3000};
|
modified: 3000};
|
||||||
await store.applyIncoming(rec);
|
await store.applyIncoming(rec);
|
||||||
deepEqual(store._remoteClients["id3"], { lastModified: 3000, foo3: "bar3" });
|
deepEqual(store._remoteClients.id3, { lastModified: 3000, foo3: "bar3" });
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_getAllTabs() {
|
add_task(async function test_getAllTabs() {
|
||||||
|
|
|
@ -171,19 +171,19 @@ var Authentication = {
|
||||||
signIn: function signIn(account) {
|
signIn: function signIn(account) {
|
||||||
let cb = Async.makeSpinningCallback();
|
let cb = Async.makeSpinningCallback();
|
||||||
|
|
||||||
Logger.AssertTrue(account["username"], "Username has been found");
|
Logger.AssertTrue(account.username, "Username has been found");
|
||||||
Logger.AssertTrue(account["password"], "Password has been found");
|
Logger.AssertTrue(account.password, "Password has been found");
|
||||||
|
|
||||||
Logger.logInfo("Login user: " + account["username"]);
|
Logger.logInfo("Login user: " + account.username);
|
||||||
|
|
||||||
// Required here since we don't go through the real login page
|
// Required here since we don't go through the real login page
|
||||||
Async.promiseSpinningly(FxAccountsConfig.ensureConfigured());
|
Async.promiseSpinningly(FxAccountsConfig.ensureConfigured());
|
||||||
|
|
||||||
let client = new FxAccountsClient();
|
let client = new FxAccountsClient();
|
||||||
client.signIn(account["username"], account["password"], true).then(credentials => {
|
client.signIn(account.username, account.password, true).then(credentials => {
|
||||||
return fxAccounts.setSignedInUser(credentials);
|
return fxAccounts.setSignedInUser(credentials);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
return this._completeVerification(account["username"])
|
return this._completeVerification(account.username)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
cb(null, true);
|
cb(null, true);
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|
|
@ -507,10 +507,10 @@ var TPS = {
|
||||||
for (let bookmark of bookmarks[folder]) {
|
for (let bookmark of bookmarks[folder]) {
|
||||||
Logger.clearPotentialError();
|
Logger.clearPotentialError();
|
||||||
let placesItem;
|
let placesItem;
|
||||||
bookmark["location"] = folder;
|
bookmark.location = folder;
|
||||||
|
|
||||||
if (last_item_pos != -1)
|
if (last_item_pos != -1)
|
||||||
bookmark["last_item_pos"] = last_item_pos;
|
bookmark.last_item_pos = last_item_pos;
|
||||||
let item_id = -1;
|
let item_id = -1;
|
||||||
|
|
||||||
if (action != ACTION_MODIFY && action != ACTION_DELETE)
|
if (action != ACTION_MODIFY && action != ACTION_DELETE)
|
||||||
|
|
|
@ -280,7 +280,7 @@ evaluate.toJSON = function(obj, seenEls) {
|
||||||
return element.makeWebElement(uuid);
|
return element.makeWebElement(uuid);
|
||||||
|
|
||||||
// custom JSON representation
|
// custom JSON representation
|
||||||
} else if (typeof obj["toJSON"] == "function") {
|
} else if (typeof obj.toJSON == "function") {
|
||||||
let unsafeJSON = obj.toJSON();
|
let unsafeJSON = obj.toJSON();
|
||||||
return evaluate.toJSON(unsafeJSON, seenEls);
|
return evaluate.toJSON(unsafeJSON, seenEls);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1370,10 +1370,10 @@ event.sendEvent = function(eventType, el, modifiers = {}, opts = {}) {
|
||||||
let doc = el.ownerDocument || el.document;
|
let doc = el.ownerDocument || el.document;
|
||||||
let ev = doc.createEvent("Event");
|
let ev = doc.createEvent("Event");
|
||||||
|
|
||||||
ev.shiftKey = modifiers["shift"];
|
ev.shiftKey = modifiers.shift;
|
||||||
ev.metaKey = modifiers["meta"];
|
ev.metaKey = modifiers.meta;
|
||||||
ev.altKey = modifiers["alt"];
|
ev.altKey = modifiers.alt;
|
||||||
ev.ctrlKey = modifiers["ctrl"];
|
ev.ctrlKey = modifiers.ctrl;
|
||||||
|
|
||||||
ev.initEvent(eventType, opts.canBubble, true);
|
ev.initEvent(eventType, opts.canBubble, true);
|
||||||
el.dispatchEvent(ev);
|
el.dispatchEvent(ev);
|
||||||
|
|
|
@ -73,7 +73,7 @@ reftest.Runner = class {
|
||||||
this.parentWindow = assert.window(this.driver.getCurrentWindow());
|
this.parentWindow = assert.window(this.driver.getCurrentWindow());
|
||||||
|
|
||||||
this.screenshotMode = SCREENSHOT_MODE[screenshotMode] ||
|
this.screenshotMode = SCREENSHOT_MODE[screenshotMode] ||
|
||||||
SCREENSHOT_MODE["unexpected"];
|
SCREENSHOT_MODE.unexpected;
|
||||||
|
|
||||||
this.urlCount = Object.keys(urlCount || {})
|
this.urlCount = Object.keys(urlCount || {})
|
||||||
.reduce((map, key) => map.set(key, urlCount[key]), new Map());
|
.reduce((map, key) => map.set(key, urlCount[key]), new Map());
|
||||||
|
|
|
@ -21,7 +21,7 @@ async function painted() {
|
||||||
|
|
||||||
let startupInfo = await TalosPowersContent.getStartupInfo();
|
let startupInfo = await TalosPowersContent.getStartupInfo();
|
||||||
|
|
||||||
let startupTime = startupInfo["firstPaint"] - startupInfo["process"];
|
let startupTime = startupInfo.firstPaint - startupInfo.process;
|
||||||
|
|
||||||
document.body.textContent = "Startup time = " + startupTime + " ms";
|
document.body.textContent = "Startup time = " + startupTime + " ms";
|
||||||
if (window.dump) {
|
if (window.dump) {
|
||||||
|
|
|
@ -244,7 +244,7 @@ TalosPowersService.prototype = {
|
||||||
let mm = message.target.messageManager;
|
let mm = message.target.messageManager;
|
||||||
let startupInfo = Services.startup.getStartupInfo();
|
let startupInfo = Services.startup.getStartupInfo();
|
||||||
|
|
||||||
if (!startupInfo["firstPaint"]) {
|
if (!startupInfo.firstPaint) {
|
||||||
// It's possible that we were called early enough that
|
// It's possible that we were called early enough that
|
||||||
// the firstPaint measurement hasn't been set yet. In
|
// the firstPaint measurement hasn't been set yet. In
|
||||||
// that case, we set up an observer for the next time
|
// that case, we set up an observer for the next time
|
||||||
|
|
|
@ -669,11 +669,11 @@ Tart.prototype = {
|
||||||
sequenceArray = [];
|
sequenceArray = [];
|
||||||
for (var i in this._config.subtests) {
|
for (var i in this._config.subtests) {
|
||||||
for (var r = 0; r < this._config.repeat; r++) {
|
for (var r = 0; r < this._config.repeat; r++) {
|
||||||
sequenceArray = sequenceArray.concat(subtests["init"]);
|
sequenceArray = sequenceArray.concat(subtests.init);
|
||||||
sequenceArray = sequenceArray.concat(subtests[this._config.subtests[i]]);
|
sequenceArray = sequenceArray.concat(subtests[this._config.subtests[i]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sequenceArray = sequenceArray.concat(subtests["restore"]);
|
sequenceArray = sequenceArray.concat(subtests.restore);
|
||||||
|
|
||||||
this._doSequence(sequenceArray, this._doneInternal);
|
this._doSequence(sequenceArray, this._doneInternal);
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
do_check_true(typeof(this["MODULE_IMPORTED"]) == "undefined");
|
do_check_true(typeof(this.MODULE_IMPORTED) == "undefined");
|
||||||
do_check_true(typeof(this["MODULE_URI"]) == "undefined");
|
do_check_true(typeof(this.MODULE_URI) == "undefined");
|
||||||
let uri = "resource://test/import_module.jsm";
|
let uri = "resource://test/import_module.jsm";
|
||||||
Components.utils.import(uri);
|
Components.utils.import(uri);
|
||||||
do_check_true(MODULE_URI == uri);
|
do_check_true(MODULE_URI == uri);
|
||||||
|
|
|
@ -1029,8 +1029,8 @@ function appendAboutMemoryMain(aProcessReports, aHasMozMallocUsableSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then sort by resident size.
|
// Then sort by resident size.
|
||||||
let nodeA = pcollsByProcess[aProcessA]._degenerates["resident"];
|
let nodeA = pcollsByProcess[aProcessA]._degenerates.resident;
|
||||||
let nodeB = pcollsByProcess[aProcessB]._degenerates["resident"];
|
let nodeB = pcollsByProcess[aProcessB]._degenerates.resident;
|
||||||
let residentA = nodeA ? nodeA._amount : -1;
|
let residentA = nodeA ? nodeA._amount : -1;
|
||||||
let residentB = nodeB ? nodeB._amount : -1;
|
let residentB = nodeB ? nodeB._amount : -1;
|
||||||
|
|
||||||
|
|
|
@ -260,8 +260,8 @@ CaptivePortalDetector.prototype = {
|
||||||
let request = {interfaceName: aInterfaceName};
|
let request = {interfaceName: aInterfaceName};
|
||||||
if (aCallback) {
|
if (aCallback) {
|
||||||
let callback = aCallback.QueryInterface(Ci.nsICaptivePortalCallback);
|
let callback = aCallback.QueryInterface(Ci.nsICaptivePortalCallback);
|
||||||
request["callback"] = callback;
|
request.callback = callback;
|
||||||
request["retryCount"] = 0;
|
request.retryCount = 0;
|
||||||
}
|
}
|
||||||
this._addRequest(request);
|
this._addRequest(request);
|
||||||
},
|
},
|
||||||
|
@ -332,7 +332,7 @@ CaptivePortalDetector.prototype = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this._runningRequest["urlFetcher"] = urlFetcher;
|
this._runningRequest.urlFetcher = urlFetcher;
|
||||||
},
|
},
|
||||||
|
|
||||||
_startLogin: function _startLogin() {
|
_startLogin: function _startLogin() {
|
||||||
|
@ -343,7 +343,7 @@ CaptivePortalDetector.prototype = {
|
||||||
url: this._canonicalSiteURL,
|
url: this._canonicalSiteURL,
|
||||||
};
|
};
|
||||||
this._loginObserver.attach();
|
this._loginObserver.attach();
|
||||||
this._runningRequest["eventId"] = id;
|
this._runningRequest.eventId = id;
|
||||||
this._sendEvent(kOpenCaptivePortalLoginEvent, details);
|
this._sendEvent(kOpenCaptivePortalLoginEvent, details);
|
||||||
gSysMsgr.broadcastMessage(kCaptivePortalSystemMessage, {});
|
gSysMsgr.broadcastMessage(kCaptivePortalSystemMessage, {});
|
||||||
},
|
},
|
||||||
|
@ -369,13 +369,13 @@ CaptivePortalDetector.prototype = {
|
||||||
if (this._runningRequest.hasOwnProperty("eventId") && success) {
|
if (this._runningRequest.hasOwnProperty("eventId") && success) {
|
||||||
let details = {
|
let details = {
|
||||||
type: kCaptivePortalLoginSuccessEvent,
|
type: kCaptivePortalLoginSuccessEvent,
|
||||||
id: this._runningRequest["eventId"],
|
id: this._runningRequest.eventId,
|
||||||
};
|
};
|
||||||
this._sendEvent(kCaptivePortalLoginSuccessEvent, details);
|
this._sendEvent(kCaptivePortalLoginSuccessEvent, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continue the following request
|
// Continue the following request
|
||||||
this._runningRequest["complete"] = true;
|
this._runningRequest.complete = true;
|
||||||
this._removeRequest(this._runningRequest.interfaceName);
|
this._removeRequest(this._runningRequest.interfaceName);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -391,8 +391,8 @@ ContentPrefService.prototype = {
|
||||||
selectGroupsStmt.params.setting = settingID;
|
selectGroupsStmt.params.setting = settingID;
|
||||||
|
|
||||||
while (selectGroupsStmt.executeStep()) {
|
while (selectGroupsStmt.executeStep()) {
|
||||||
groupIDs.push(selectGroupsStmt.row["groupID"]);
|
groupIDs.push(selectGroupsStmt.row.groupID);
|
||||||
groupNames.push(selectGroupsStmt.row["groupName"]);
|
groupNames.push(selectGroupsStmt.row.groupName);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
selectGroupsStmt.reset();
|
selectGroupsStmt.reset();
|
||||||
|
@ -602,7 +602,7 @@ ContentPrefService.prototype = {
|
||||||
}});
|
}});
|
||||||
} else {
|
} else {
|
||||||
if (this._stmtSelectPref.executeStep()) {
|
if (this._stmtSelectPref.executeStep()) {
|
||||||
value = this._stmtSelectPref.row["value"];
|
value = this._stmtSelectPref.row.value;
|
||||||
}
|
}
|
||||||
this._cache.set(aGroup, aSetting, value);
|
this._cache.set(aGroup, aSetting, value);
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,7 @@ ContentPrefService.prototype = {
|
||||||
}});
|
}});
|
||||||
} else {
|
} else {
|
||||||
if (this._stmtSelectGlobalPref.executeStep()) {
|
if (this._stmtSelectGlobalPref.executeStep()) {
|
||||||
value = this._stmtSelectGlobalPref.row["value"];
|
value = this._stmtSelectGlobalPref.row.value;
|
||||||
}
|
}
|
||||||
this._cache.set(null, aName, value);
|
this._cache.set(null, aName, value);
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectGroupID.params.name = aName;
|
this._stmtSelectGroupID.params.name = aName;
|
||||||
|
|
||||||
if (this._stmtSelectGroupID.executeStep())
|
if (this._stmtSelectGroupID.executeStep())
|
||||||
id = this._stmtSelectGroupID.row["id"];
|
id = this._stmtSelectGroupID.row.id;
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectGroupID.reset();
|
this._stmtSelectGroupID.reset();
|
||||||
}
|
}
|
||||||
|
@ -720,7 +720,7 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectSettingID.params.name = aName;
|
this._stmtSelectSettingID.params.name = aName;
|
||||||
|
|
||||||
if (this._stmtSelectSettingID.executeStep())
|
if (this._stmtSelectSettingID.executeStep())
|
||||||
id = this._stmtSelectSettingID.row["id"];
|
id = this._stmtSelectSettingID.row.id;
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectSettingID.reset();
|
this._stmtSelectSettingID.reset();
|
||||||
}
|
}
|
||||||
|
@ -762,7 +762,7 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectPrefID.params.settingID = aSettingID;
|
this._stmtSelectPrefID.params.settingID = aSettingID;
|
||||||
|
|
||||||
if (this._stmtSelectPrefID.executeStep())
|
if (this._stmtSelectPrefID.executeStep())
|
||||||
id = this._stmtSelectPrefID.row["id"];
|
id = this._stmtSelectPrefID.row.id;
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectPrefID.reset();
|
this._stmtSelectPrefID.reset();
|
||||||
}
|
}
|
||||||
|
@ -787,7 +787,7 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectGlobalPrefID.params.settingID = aSettingID;
|
this._stmtSelectGlobalPrefID.params.settingID = aSettingID;
|
||||||
|
|
||||||
if (this._stmtSelectGlobalPrefID.executeStep())
|
if (this._stmtSelectGlobalPrefID.executeStep())
|
||||||
id = this._stmtSelectGlobalPrefID.row["id"];
|
id = this._stmtSelectGlobalPrefID.row.id;
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectGlobalPrefID.reset();
|
this._stmtSelectGlobalPrefID.reset();
|
||||||
}
|
}
|
||||||
|
@ -899,8 +899,8 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectPrefs.params.group = aGroup;
|
this._stmtSelectPrefs.params.group = aGroup;
|
||||||
|
|
||||||
while (this._stmtSelectPrefs.executeStep())
|
while (this._stmtSelectPrefs.executeStep())
|
||||||
prefs.setProperty(this._stmtSelectPrefs.row["name"],
|
prefs.setProperty(this._stmtSelectPrefs.row.name,
|
||||||
this._stmtSelectPrefs.row["value"]);
|
this._stmtSelectPrefs.row.value);
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectPrefs.reset();
|
this._stmtSelectPrefs.reset();
|
||||||
}
|
}
|
||||||
|
@ -927,8 +927,8 @@ ContentPrefService.prototype = {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (this._stmtSelectGlobalPrefs.executeStep())
|
while (this._stmtSelectGlobalPrefs.executeStep())
|
||||||
prefs.setProperty(this._stmtSelectGlobalPrefs.row["name"],
|
prefs.setProperty(this._stmtSelectGlobalPrefs.row.name,
|
||||||
this._stmtSelectGlobalPrefs.row["value"]);
|
this._stmtSelectGlobalPrefs.row.value);
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectGlobalPrefs.reset();
|
this._stmtSelectGlobalPrefs.reset();
|
||||||
}
|
}
|
||||||
|
@ -958,8 +958,8 @@ ContentPrefService.prototype = {
|
||||||
this._stmtSelectPrefsByName.params.setting = aName;
|
this._stmtSelectPrefsByName.params.setting = aName;
|
||||||
|
|
||||||
while (this._stmtSelectPrefsByName.executeStep())
|
while (this._stmtSelectPrefsByName.executeStep())
|
||||||
prefs.setProperty(this._stmtSelectPrefsByName.row["groupName"],
|
prefs.setProperty(this._stmtSelectPrefsByName.row.groupName,
|
||||||
this._stmtSelectPrefsByName.row["value"]);
|
this._stmtSelectPrefsByName.row.value);
|
||||||
} finally {
|
} finally {
|
||||||
this._stmtSelectPrefsByName.reset();
|
this._stmtSelectPrefsByName.reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,9 +120,6 @@ module.exports = {
|
||||||
// Enforce dots on the next line with property name.
|
// Enforce dots on the next line with property name.
|
||||||
"dot-location": ["error", "property"],
|
"dot-location": ["error", "property"],
|
||||||
|
|
||||||
// Encourage the use of dot notation whenever possible.
|
|
||||||
"dot-notation": "error",
|
|
||||||
|
|
||||||
// Allow using == instead of ===, in the interest of landing something since
|
// Allow using == instead of ===, in the interest of landing something since
|
||||||
// the devtools codebase is split on convention here.
|
// the devtools codebase is split on convention here.
|
||||||
"eqeqeq": "off",
|
"eqeqeq": "off",
|
||||||
|
|
|
@ -11,7 +11,6 @@ module.exports = {
|
||||||
"complexity": ["error", {"max": 20}],
|
"complexity": ["error", {"max": 20}],
|
||||||
"curly": "error",
|
"curly": "error",
|
||||||
"dot-location": ["warn", "property"],
|
"dot-location": ["warn", "property"],
|
||||||
"dot-notation": "error",
|
|
||||||
"generator-star-spacing": ["warn", "after"],
|
"generator-star-spacing": ["warn", "after"],
|
||||||
"indent": ["warn", 2, {"SwitchCase": 1}],
|
"indent": ["warn", 2, {"SwitchCase": 1}],
|
||||||
"max-len": ["warn", 80, 2, {"ignoreUrls": true}],
|
"max-len": ["warn", 80, 2, {"ignoreUrls": true}],
|
||||||
|
|
|
@ -711,21 +711,21 @@ LoginManagerStorage_mozStorage.prototype = {
|
||||||
conditions.push("hostname isnull");
|
conditions.push("hostname isnull");
|
||||||
} else if (hostname != "") {
|
} else if (hostname != "") {
|
||||||
conditions.push("hostname = :hostname");
|
conditions.push("hostname = :hostname");
|
||||||
params["hostname"] = hostname;
|
params.hostname = hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formSubmitURL == null) {
|
if (formSubmitURL == null) {
|
||||||
conditions.push("formSubmitURL isnull");
|
conditions.push("formSubmitURL isnull");
|
||||||
} else if (formSubmitURL != "") {
|
} else if (formSubmitURL != "") {
|
||||||
conditions.push("formSubmitURL = :formSubmitURL OR formSubmitURL = ''");
|
conditions.push("formSubmitURL = :formSubmitURL OR formSubmitURL = ''");
|
||||||
params["formSubmitURL"] = formSubmitURL;
|
params.formSubmitURL = formSubmitURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpRealm == null) {
|
if (httpRealm == null) {
|
||||||
conditions.push("httpRealm isnull");
|
conditions.push("httpRealm isnull");
|
||||||
} else if (httpRealm != "") {
|
} else if (httpRealm != "") {
|
||||||
conditions.push("httpRealm = :httpRealm");
|
conditions.push("httpRealm = :httpRealm");
|
||||||
params["httpRealm"] = httpRealm;
|
params.httpRealm = httpRealm;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [conditions, params];
|
return [conditions, params];
|
||||||
|
|
|
@ -132,7 +132,7 @@ function checkLoginItems(logins, items) {
|
||||||
* Gets the list of expected logins for a hostname.
|
* Gets the list of expected logins for a hostname.
|
||||||
*/
|
*/
|
||||||
function getExpectedLogins(hostname) {
|
function getExpectedLogins(hostname) {
|
||||||
return Services.logins.getAllLogins().filter(entry => entry["hostname"] === hostname);
|
return Services.logins.getAllLogins().filter(entry => entry.hostname === hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loginList() {
|
function loginList() {
|
||||||
|
|
|
@ -14,7 +14,6 @@ module.exports = {
|
||||||
}],
|
}],
|
||||||
curly: ["error", "all"],
|
curly: ["error", "all"],
|
||||||
"dot-location": ["error", "property"],
|
"dot-location": ["error", "property"],
|
||||||
"dot-notation": "error",
|
|
||||||
"generator-star-spacing": ["error", "after"],
|
"generator-star-spacing": ["error", "after"],
|
||||||
indent: ["error", 2, {
|
indent: ["error", 2, {
|
||||||
SwitchCase: 1,
|
SwitchCase: 1,
|
||||||
|
|
|
@ -316,7 +316,7 @@ this.PlacesDBUtils = {
|
||||||
query: "SELECT id FROM moz_bookmarks WHERE id = :places_root",
|
query: "SELECT id FROM moz_bookmarks WHERE id = :places_root",
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
selectPlacesRoot.params["places_root"] = PlacesUtils.placesRootId;
|
selectPlacesRoot.params.places_root = PlacesUtils.placesRootId;
|
||||||
let db = await PlacesUtils.promiseDBConnection();
|
let db = await PlacesUtils.promiseDBConnection();
|
||||||
let rows = await db.execute(selectPlacesRoot.query, selectPlacesRoot.params);
|
let rows = await db.execute(selectPlacesRoot.query, selectPlacesRoot.params);
|
||||||
if (rows.length === 0) {
|
if (rows.length === 0) {
|
||||||
|
@ -327,9 +327,9 @@ this.PlacesDBUtils = {
|
||||||
VALUES (:places_root, 2, NULL, 0, 0, :title, :guid)`,
|
VALUES (:places_root, 2, NULL, 0, 0, :title, :guid)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
createPlacesRoot.params["places_root"] = PlacesUtils.placesRootId;
|
createPlacesRoot.params.places_root = PlacesUtils.placesRootId;
|
||||||
createPlacesRoot.params["title"] = "";
|
createPlacesRoot.params.title = "";
|
||||||
createPlacesRoot.params["guid"] = PlacesUtils.bookmarks.rootGuid;
|
createPlacesRoot.params.guid = PlacesUtils.bookmarks.rootGuid;
|
||||||
cleanupStatements.push(createPlacesRoot);
|
cleanupStatements.push(createPlacesRoot);
|
||||||
|
|
||||||
// Now ensure that other roots are children of Places root.
|
// Now ensure that other roots are children of Places root.
|
||||||
|
@ -339,11 +339,11 @@ this.PlacesDBUtils = {
|
||||||
( :menuGuid, :toolbarGuid, :unfiledGuid, :tagsGuid )`,
|
( :menuGuid, :toolbarGuid, :unfiledGuid, :tagsGuid )`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixPlacesRootChildren.params["places_root"] = PlacesUtils.placesRootId;
|
fixPlacesRootChildren.params.places_root = PlacesUtils.placesRootId;
|
||||||
fixPlacesRootChildren.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
fixPlacesRootChildren.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
fixPlacesRootChildren.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
fixPlacesRootChildren.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
fixPlacesRootChildren.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
fixPlacesRootChildren.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
fixPlacesRootChildren.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
fixPlacesRootChildren.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(fixPlacesRootChildren);
|
cleanupStatements.push(fixPlacesRootChildren);
|
||||||
}
|
}
|
||||||
// C.2 fix roots titles
|
// C.2 fix roots titles
|
||||||
|
@ -356,16 +356,16 @@ this.PlacesDBUtils = {
|
||||||
query: updateRootTitleSql,
|
query: updateRootTitleSql,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixPlacesRootTitle.params["root_id"] = PlacesUtils.placesRootId;
|
fixPlacesRootTitle.params.root_id = PlacesUtils.placesRootId;
|
||||||
fixPlacesRootTitle.params["title"] = "";
|
fixPlacesRootTitle.params.title = "";
|
||||||
cleanupStatements.push(fixPlacesRootTitle);
|
cleanupStatements.push(fixPlacesRootTitle);
|
||||||
// bookmarks menu
|
// bookmarks menu
|
||||||
let fixBookmarksMenuTitle = {
|
let fixBookmarksMenuTitle = {
|
||||||
query: updateRootTitleSql,
|
query: updateRootTitleSql,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixBookmarksMenuTitle.params["root_id"] = PlacesUtils.bookmarksMenuFolderId;
|
fixBookmarksMenuTitle.params.root_id = PlacesUtils.bookmarksMenuFolderId;
|
||||||
fixBookmarksMenuTitle.params["title"] =
|
fixBookmarksMenuTitle.params.title =
|
||||||
PlacesUtils.getString("BookmarksMenuFolderTitle");
|
PlacesUtils.getString("BookmarksMenuFolderTitle");
|
||||||
cleanupStatements.push(fixBookmarksMenuTitle);
|
cleanupStatements.push(fixBookmarksMenuTitle);
|
||||||
// bookmarks toolbar
|
// bookmarks toolbar
|
||||||
|
@ -373,8 +373,8 @@ this.PlacesDBUtils = {
|
||||||
query: updateRootTitleSql,
|
query: updateRootTitleSql,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixBookmarksToolbarTitle.params["root_id"] = PlacesUtils.toolbarFolderId;
|
fixBookmarksToolbarTitle.params.root_id = PlacesUtils.toolbarFolderId;
|
||||||
fixBookmarksToolbarTitle.params["title"] =
|
fixBookmarksToolbarTitle.params.title =
|
||||||
PlacesUtils.getString("BookmarksToolbarFolderTitle");
|
PlacesUtils.getString("BookmarksToolbarFolderTitle");
|
||||||
cleanupStatements.push(fixBookmarksToolbarTitle);
|
cleanupStatements.push(fixBookmarksToolbarTitle);
|
||||||
// unsorted bookmarks
|
// unsorted bookmarks
|
||||||
|
@ -382,8 +382,8 @@ this.PlacesDBUtils = {
|
||||||
query: updateRootTitleSql,
|
query: updateRootTitleSql,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixUnsortedBookmarksTitle.params["root_id"] = PlacesUtils.unfiledBookmarksFolderId;
|
fixUnsortedBookmarksTitle.params.root_id = PlacesUtils.unfiledBookmarksFolderId;
|
||||||
fixUnsortedBookmarksTitle.params["title"] =
|
fixUnsortedBookmarksTitle.params.title =
|
||||||
PlacesUtils.getString("OtherBookmarksFolderTitle");
|
PlacesUtils.getString("OtherBookmarksFolderTitle");
|
||||||
cleanupStatements.push(fixUnsortedBookmarksTitle);
|
cleanupStatements.push(fixUnsortedBookmarksTitle);
|
||||||
// tags
|
// tags
|
||||||
|
@ -391,8 +391,8 @@ this.PlacesDBUtils = {
|
||||||
query: updateRootTitleSql,
|
query: updateRootTitleSql,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixTagsRootTitle.params["root_id"] = PlacesUtils.tagsFolderId;
|
fixTagsRootTitle.params.root_id = PlacesUtils.tagsFolderId;
|
||||||
fixTagsRootTitle.params["title"] =
|
fixTagsRootTitle.params.title =
|
||||||
PlacesUtils.getString("TagsFolderTitle");
|
PlacesUtils.getString("TagsFolderTitle");
|
||||||
cleanupStatements.push(fixTagsRootTitle);
|
cleanupStatements.push(fixTagsRootTitle);
|
||||||
|
|
||||||
|
@ -410,12 +410,12 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
deleteNoPlaceItems.params["bookmark_type"] = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
deleteNoPlaceItems.params.bookmark_type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
||||||
deleteNoPlaceItems.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
deleteNoPlaceItems.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
deleteNoPlaceItems.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
deleteNoPlaceItems.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
deleteNoPlaceItems.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
deleteNoPlaceItems.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
deleteNoPlaceItems.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
deleteNoPlaceItems.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
deleteNoPlaceItems.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
deleteNoPlaceItems.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(deleteNoPlaceItems);
|
cleanupStatements.push(deleteNoPlaceItems);
|
||||||
|
|
||||||
// D.2 remove items that are not uri bookmarks from tag containers
|
// D.2 remove items that are not uri bookmarks from tag containers
|
||||||
|
@ -431,13 +431,13 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
deleteBogusTagChildren.params["tags_folder"] = PlacesUtils.tagsFolderId;
|
deleteBogusTagChildren.params.tags_folder = PlacesUtils.tagsFolderId;
|
||||||
deleteBogusTagChildren.params["bookmark_type"] = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
deleteBogusTagChildren.params.bookmark_type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
||||||
deleteBogusTagChildren.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
deleteBogusTagChildren.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
deleteBogusTagChildren.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
deleteBogusTagChildren.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
deleteBogusTagChildren.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
deleteBogusTagChildren.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
deleteBogusTagChildren.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
deleteBogusTagChildren.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
deleteBogusTagChildren.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
deleteBogusTagChildren.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(deleteBogusTagChildren);
|
cleanupStatements.push(deleteBogusTagChildren);
|
||||||
|
|
||||||
// D.3 remove empty tags
|
// D.3 remove empty tags
|
||||||
|
@ -454,12 +454,12 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
deleteEmptyTags.params["tags_folder"] = PlacesUtils.tagsFolderId;
|
deleteEmptyTags.params.tags_folder = PlacesUtils.tagsFolderId;
|
||||||
deleteEmptyTags.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
deleteEmptyTags.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
deleteEmptyTags.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
deleteEmptyTags.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
deleteEmptyTags.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
deleteEmptyTags.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
deleteEmptyTags.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
deleteEmptyTags.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
deleteEmptyTags.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
deleteEmptyTags.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(deleteEmptyTags);
|
cleanupStatements.push(deleteEmptyTags);
|
||||||
|
|
||||||
// D.4 move orphan items to unsorted folder
|
// D.4 move orphan items to unsorted folder
|
||||||
|
@ -474,12 +474,12 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixOrphanItems.params["unsorted_folder"] = PlacesUtils.unfiledBookmarksFolderId;
|
fixOrphanItems.params.unsorted_folder = PlacesUtils.unfiledBookmarksFolderId;
|
||||||
fixOrphanItems.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
fixOrphanItems.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
fixOrphanItems.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
fixOrphanItems.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
fixOrphanItems.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
fixOrphanItems.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
fixOrphanItems.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
fixOrphanItems.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
fixOrphanItems.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
fixOrphanItems.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(fixOrphanItems);
|
cleanupStatements.push(fixOrphanItems);
|
||||||
|
|
||||||
// D.6 fix wrong item types
|
// D.6 fix wrong item types
|
||||||
|
@ -497,14 +497,14 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixBookmarksAsFolders.params["bookmark_type"] = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
fixBookmarksAsFolders.params.bookmark_type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
||||||
fixBookmarksAsFolders.params["folder_type"] = PlacesUtils.bookmarks.TYPE_FOLDER;
|
fixBookmarksAsFolders.params.folder_type = PlacesUtils.bookmarks.TYPE_FOLDER;
|
||||||
fixBookmarksAsFolders.params["separator_type"] = PlacesUtils.bookmarks.TYPE_SEPARATOR;
|
fixBookmarksAsFolders.params.separator_type = PlacesUtils.bookmarks.TYPE_SEPARATOR;
|
||||||
fixBookmarksAsFolders.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
fixBookmarksAsFolders.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
fixBookmarksAsFolders.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
fixBookmarksAsFolders.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
fixBookmarksAsFolders.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
fixBookmarksAsFolders.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
fixBookmarksAsFolders.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
fixBookmarksAsFolders.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
fixBookmarksAsFolders.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
fixBookmarksAsFolders.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(fixBookmarksAsFolders);
|
cleanupStatements.push(fixBookmarksAsFolders);
|
||||||
|
|
||||||
// D.7 fix wrong item types
|
// D.7 fix wrong item types
|
||||||
|
@ -521,13 +521,13 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixFoldersAsBookmarks.params["bookmark_type"] = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
fixFoldersAsBookmarks.params.bookmark_type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
||||||
fixFoldersAsBookmarks.params["folder_type"] = PlacesUtils.bookmarks.TYPE_FOLDER;
|
fixFoldersAsBookmarks.params.folder_type = PlacesUtils.bookmarks.TYPE_FOLDER;
|
||||||
fixFoldersAsBookmarks.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
fixFoldersAsBookmarks.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
fixFoldersAsBookmarks.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
fixFoldersAsBookmarks.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
fixFoldersAsBookmarks.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
fixFoldersAsBookmarks.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
fixFoldersAsBookmarks.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
fixFoldersAsBookmarks.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
fixFoldersAsBookmarks.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
fixFoldersAsBookmarks.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(fixFoldersAsBookmarks);
|
cleanupStatements.push(fixFoldersAsBookmarks);
|
||||||
|
|
||||||
// D.9 fix wrong parents
|
// D.9 fix wrong parents
|
||||||
|
@ -546,14 +546,14 @@ this.PlacesDBUtils = {
|
||||||
)`,
|
)`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixInvalidParents.params["unsorted_folder"] = PlacesUtils.unfiledBookmarksFolderId;
|
fixInvalidParents.params.unsorted_folder = PlacesUtils.unfiledBookmarksFolderId;
|
||||||
fixInvalidParents.params["bookmark_type"] = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
fixInvalidParents.params.bookmark_type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
|
||||||
fixInvalidParents.params["separator_type"] = PlacesUtils.bookmarks.TYPE_SEPARATOR;
|
fixInvalidParents.params.separator_type = PlacesUtils.bookmarks.TYPE_SEPARATOR;
|
||||||
fixInvalidParents.params["rootGuid"] = PlacesUtils.bookmarks.rootGuid;
|
fixInvalidParents.params.rootGuid = PlacesUtils.bookmarks.rootGuid;
|
||||||
fixInvalidParents.params["menuGuid"] = PlacesUtils.bookmarks.menuGuid;
|
fixInvalidParents.params.menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||||
fixInvalidParents.params["toolbarGuid"] = PlacesUtils.bookmarks.toolbarGuid;
|
fixInvalidParents.params.toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
|
||||||
fixInvalidParents.params["unfiledGuid"] = PlacesUtils.bookmarks.unfiledGuid;
|
fixInvalidParents.params.unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
|
||||||
fixInvalidParents.params["tagsGuid"] = PlacesUtils.bookmarks.tagsGuid;
|
fixInvalidParents.params.tagsGuid = PlacesUtils.bookmarks.tagsGuid;
|
||||||
cleanupStatements.push(fixInvalidParents);
|
cleanupStatements.push(fixInvalidParents);
|
||||||
|
|
||||||
// D.10 recalculate positions
|
// D.10 recalculate positions
|
||||||
|
@ -627,9 +627,9 @@ this.PlacesDBUtils = {
|
||||||
AND parent = :tags_folder`,
|
AND parent = :tags_folder`,
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
fixEmptyNamedTags.params["empty_title"] = "(notitle)";
|
fixEmptyNamedTags.params.empty_title = "(notitle)";
|
||||||
fixEmptyNamedTags.params["folder_type"] = PlacesUtils.bookmarks.TYPE_FOLDER;
|
fixEmptyNamedTags.params.folder_type = PlacesUtils.bookmarks.TYPE_FOLDER;
|
||||||
fixEmptyNamedTags.params["tags_folder"] = PlacesUtils.tagsFolderId;
|
fixEmptyNamedTags.params.tags_folder = PlacesUtils.tagsFolderId;
|
||||||
cleanupStatements.push(fixEmptyNamedTags);
|
cleanupStatements.push(fixEmptyNamedTags);
|
||||||
|
|
||||||
// MOZ_ICONS
|
// MOZ_ICONS
|
||||||
|
|
|
@ -802,12 +802,12 @@ nsPlacesExpiration.prototype = {
|
||||||
* invoked on success, function (aPagesCount).
|
* invoked on success, function (aPagesCount).
|
||||||
*/
|
*/
|
||||||
_getPagesStats: function PEX__getPagesStats(aCallback) {
|
_getPagesStats: function PEX__getPagesStats(aCallback) {
|
||||||
if (!this._cachedStatements["LIMIT_COUNT"]) {
|
if (!this._cachedStatements.LIMIT_COUNT) {
|
||||||
this._cachedStatements["LIMIT_COUNT"] = this._db.createAsyncStatement(
|
this._cachedStatements.LIMIT_COUNT = this._db.createAsyncStatement(
|
||||||
`SELECT COUNT(*) FROM moz_places`
|
`SELECT COUNT(*) FROM moz_places`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this._cachedStatements["LIMIT_COUNT"].executeAsync({
|
this._cachedStatements.LIMIT_COUNT.executeAsync({
|
||||||
_pagesCount: 0,
|
_pagesCount: 0,
|
||||||
handleResult(aResults) {
|
handleResult(aResults) {
|
||||||
let row = aResults.getNextRow();
|
let row = aResults.getNextRow();
|
||||||
|
|
|
@ -43,21 +43,21 @@ function addPlace(aUrl, aFavicon) {
|
||||||
let href = new URL(aUrl || "http://www.mozilla.org").href;
|
let href = new URL(aUrl || "http://www.mozilla.org").href;
|
||||||
let stmt = mDBConn.createStatement(
|
let stmt = mDBConn.createStatement(
|
||||||
"INSERT INTO moz_places (url, url_hash) VALUES (:url, hash(:url))");
|
"INSERT INTO moz_places (url, url_hash) VALUES (:url, hash(:url))");
|
||||||
stmt.params["url"] = href;
|
stmt.params.url = href;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
let id = mDBConn.lastInsertRowID;
|
let id = mDBConn.lastInsertRowID;
|
||||||
if (aFavicon) {
|
if (aFavicon) {
|
||||||
stmt = mDBConn.createStatement(
|
stmt = mDBConn.createStatement(
|
||||||
"INSERT INTO moz_pages_w_icons (page_url, page_url_hash) VALUES (:url, hash(:url))");
|
"INSERT INTO moz_pages_w_icons (page_url, page_url_hash) VALUES (:url, hash(:url))");
|
||||||
stmt.params["url"] = href;
|
stmt.params.url = href;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement(
|
stmt = mDBConn.createStatement(
|
||||||
"INSERT INTO moz_icons_to_pages (page_id, icon_id) " +
|
"INSERT INTO moz_icons_to_pages (page_id, icon_id) " +
|
||||||
"VALUES ((SELECT id FROM moz_pages_w_icons WHERE page_url_hash = hash(:url)), :favicon)");
|
"VALUES ((SELECT id FROM moz_pages_w_icons WHERE page_url_hash = hash(:url)), :favicon)");
|
||||||
stmt.params["url"] = href;
|
stmt.params.url = href;
|
||||||
stmt.params["favicon"] = aFavicon;
|
stmt.params.favicon = aFavicon;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -70,12 +70,12 @@ function addBookmark(aPlaceId, aType, aParent, aKeywordId, aFolderType, aTitle)
|
||||||
title, guid)
|
title, guid)
|
||||||
VALUES (:place_id, :type, :parent, :keyword_id, :folder_type, :title,
|
VALUES (:place_id, :type, :parent, :keyword_id, :folder_type, :title,
|
||||||
GENERATE_GUID())`);
|
GENERATE_GUID())`);
|
||||||
stmt.params["place_id"] = aPlaceId || null;
|
stmt.params.place_id = aPlaceId || null;
|
||||||
stmt.params["type"] = aType || bs.TYPE_BOOKMARK;
|
stmt.params.type = aType || bs.TYPE_BOOKMARK;
|
||||||
stmt.params["parent"] = aParent || bs.unfiledBookmarksFolder;
|
stmt.params.parent = aParent || bs.unfiledBookmarksFolder;
|
||||||
stmt.params["keyword_id"] = aKeywordId || null;
|
stmt.params.keyword_id = aKeywordId || null;
|
||||||
stmt.params["folder_type"] = aFolderType || null;
|
stmt.params.folder_type = aFolderType || null;
|
||||||
stmt.params["title"] = typeof(aTitle) == "string" ? aTitle : null;
|
stmt.params.title = typeof(aTitle) == "string" ? aTitle : null;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
return mDBConn.lastInsertRowID;
|
return mDBConn.lastInsertRowID;
|
||||||
|
@ -102,7 +102,7 @@ tests.push({
|
||||||
let stmt = mDBConn.createStatement(
|
let stmt = mDBConn.createStatement(
|
||||||
"INSERT INTO moz_anno_attributes (name) VALUES (:anno)"
|
"INSERT INTO moz_anno_attributes (name) VALUES (:anno)"
|
||||||
);
|
);
|
||||||
stmt.params["anno"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno = this._obsoleteWeaveAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement(
|
stmt = mDBConn.createStatement(
|
||||||
|
@ -111,8 +111,8 @@ tests.push({
|
||||||
(SELECT id FROM moz_anno_attributes WHERE name = :anno)
|
(SELECT id FROM moz_anno_attributes WHERE name = :anno)
|
||||||
)`
|
)`
|
||||||
);
|
);
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.params["anno"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno = this._obsoleteWeaveAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -122,7 +122,7 @@ tests.push({
|
||||||
let stmt = mDBConn.createStatement(
|
let stmt = mDBConn.createStatement(
|
||||||
"SELECT id FROM moz_anno_attributes WHERE name = :anno"
|
"SELECT id FROM moz_anno_attributes WHERE name = :anno"
|
||||||
);
|
);
|
||||||
stmt.params["anno"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno = this._obsoleteWeaveAttribute;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -148,9 +148,9 @@ tests.push({
|
||||||
`INSERT INTO moz_anno_attributes (name)
|
`INSERT INTO moz_anno_attributes (name)
|
||||||
VALUES (:anno1), (:anno2), (:anno3)`
|
VALUES (:anno1), (:anno2), (:anno3)`
|
||||||
);
|
);
|
||||||
stmt.params["anno1"] = this._obsoleteSyncAttribute;
|
stmt.params.anno1 = this._obsoleteSyncAttribute;
|
||||||
stmt.params["anno2"] = this._obsoleteGuidAttribute;
|
stmt.params.anno2 = this._obsoleteGuidAttribute;
|
||||||
stmt.params["anno3"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno3 = this._obsoleteWeaveAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement(
|
stmt = mDBConn.createStatement(
|
||||||
|
@ -159,10 +159,10 @@ tests.push({
|
||||||
FROM moz_anno_attributes
|
FROM moz_anno_attributes
|
||||||
WHERE name IN (:anno1, :anno2, :anno3)`
|
WHERE name IN (:anno1, :anno2, :anno3)`
|
||||||
);
|
);
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.params["anno1"] = this._obsoleteSyncAttribute;
|
stmt.params.anno1 = this._obsoleteSyncAttribute;
|
||||||
stmt.params["anno2"] = this._obsoleteGuidAttribute;
|
stmt.params.anno2 = this._obsoleteGuidAttribute;
|
||||||
stmt.params["anno3"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno3 = this._obsoleteWeaveAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -173,9 +173,9 @@ tests.push({
|
||||||
`SELECT id FROM moz_anno_attributes
|
`SELECT id FROM moz_anno_attributes
|
||||||
WHERE name IN (:anno1, :anno2, :anno3)`
|
WHERE name IN (:anno1, :anno2, :anno3)`
|
||||||
);
|
);
|
||||||
stmt.params["anno1"] = this._obsoleteSyncAttribute;
|
stmt.params.anno1 = this._obsoleteSyncAttribute;
|
||||||
stmt.params["anno2"] = this._obsoleteGuidAttribute;
|
stmt.params.anno2 = this._obsoleteGuidAttribute;
|
||||||
stmt.params["anno3"] = this._obsoleteWeaveAttribute;
|
stmt.params.anno3 = this._obsoleteWeaveAttribute;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -198,24 +198,24 @@ tests.push({
|
||||||
this._bookmarkId = addBookmark(this._placeId);
|
this._bookmarkId = addBookmark(this._placeId);
|
||||||
// Add a used attribute and an unused one.
|
// Add a used attribute and an unused one.
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["anno"] = this._unusedAttribute;
|
stmt.params.anno = this._unusedAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
|
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -223,14 +223,14 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used attributes are still there
|
// Check that used attributes are still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that unused attribute has been removed
|
// Check that unused attribute has been removed
|
||||||
stmt.params["anno"] = this._unusedAttribute;
|
stmt.params.anno = this._unusedAttribute;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -250,17 +250,17 @@ tests.push({
|
||||||
this._placeId = addPlace();
|
this._placeId = addPlace();
|
||||||
// Add a used attribute.
|
// Add a used attribute.
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Add an annotation with a nonexistent attribute
|
// Add an annotation with a nonexistent attribute
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, 1337)");
|
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, 1337)");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -268,12 +268,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used attribute is still there
|
// Check that used attribute is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// check that annotation with valid attribute is still there
|
// check that annotation with valid attribute is still there
|
||||||
stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Check that annotation with bogus attribute has been removed
|
// Check that annotation with bogus attribute has been removed
|
||||||
|
@ -297,17 +297,17 @@ tests.push({
|
||||||
this._placeId = addPlace();
|
this._placeId = addPlace();
|
||||||
// Add a used attribute.
|
// Add a used attribute.
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Add an annotation to a nonexistent page
|
// Add an annotation to a nonexistent page
|
||||||
stmt.params["place_id"] = 1337;
|
stmt.params.place_id = 1337;
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -315,12 +315,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used attribute is still there
|
// Check that used attribute is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// check that annotation with valid attribute is still there
|
// check that annotation with valid attribute is still there
|
||||||
stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
||||||
stmt.params["anno"] = this._usedPageAttribute;
|
stmt.params.anno = this._usedPageAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Check that an annotation to a nonexistent page has been removed
|
// Check that an annotation to a nonexistent page has been removed
|
||||||
|
@ -411,11 +411,11 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that valid bookmark is still there
|
// Check that valid bookmark is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id");
|
||||||
stmt.params["item_id"] = this._validItemId;
|
stmt.params.item_id = this._validItemId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that invalid bookmark has been removed
|
// Check that invalid bookmark has been removed
|
||||||
stmt.params["item_id"] = this._invalidItemId;
|
stmt.params.item_id = this._invalidItemId;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -449,18 +449,18 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that valid bookmark is still there
|
// Check that valid bookmark is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE type = :type AND parent = :parent");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE type = :type AND parent = :parent");
|
||||||
stmt.params["type"] = bs.TYPE_BOOKMARK;
|
stmt.params.type = bs.TYPE_BOOKMARK;
|
||||||
stmt.params["parent"] = this._tagId;
|
stmt.params.parent = this._tagId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that separator is no more there
|
// Check that separator is no more there
|
||||||
stmt.params["type"] = bs.TYPE_SEPARATOR;
|
stmt.params.type = bs.TYPE_SEPARATOR;
|
||||||
stmt.params["parent"] = this._tagId;
|
stmt.params.parent = this._tagId;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that folder is no more there
|
// Check that folder is no more there
|
||||||
stmt.params["type"] = bs.TYPE_FOLDER;
|
stmt.params.type = bs.TYPE_FOLDER;
|
||||||
stmt.params["parent"] = this._tagId;
|
stmt.params.parent = this._tagId;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -491,19 +491,19 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that valid bookmark is still there
|
// Check that valid bookmark is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :id AND type = :type AND parent = :parent");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :id AND type = :type AND parent = :parent");
|
||||||
stmt.params["id"] = this._bookmarkId;
|
stmt.params.id = this._bookmarkId;
|
||||||
stmt.params["type"] = bs.TYPE_BOOKMARK;
|
stmt.params.type = bs.TYPE_BOOKMARK;
|
||||||
stmt.params["parent"] = this._tagId;
|
stmt.params.parent = this._tagId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["id"] = this._tagId;
|
stmt.params.id = this._tagId;
|
||||||
stmt.params["type"] = bs.TYPE_FOLDER;
|
stmt.params.type = bs.TYPE_FOLDER;
|
||||||
stmt.params["parent"] = bs.tagsFolder;
|
stmt.params.parent = bs.tagsFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["id"] = this._emptyTagId;
|
stmt.params.id = this._emptyTagId;
|
||||||
stmt.params["type"] = bs.TYPE_FOLDER;
|
stmt.params.type = bs.TYPE_FOLDER;
|
||||||
stmt.params["parent"] = bs.tagsFolder;
|
stmt.params.parent = bs.tagsFolder;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -537,20 +537,20 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that bookmarks are now children of a real folder (unsorted)
|
// Check that bookmarks are now children of a real folder (unsorted)
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
|
||||||
stmt.params["item_id"] = this._orphanBookmarkId;
|
stmt.params.item_id = this._orphanBookmarkId;
|
||||||
stmt.params["parent"] = bs.unfiledBookmarksFolder;
|
stmt.params.parent = bs.unfiledBookmarksFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["item_id"] = this._orphanSeparatorId;
|
stmt.params.item_id = this._orphanSeparatorId;
|
||||||
stmt.params["parent"] = bs.unfiledBookmarksFolder;
|
stmt.params.parent = bs.unfiledBookmarksFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["item_id"] = this._orphanFolderId;
|
stmt.params.item_id = this._orphanFolderId;
|
||||||
stmt.params["parent"] = bs.unfiledBookmarksFolder;
|
stmt.params.parent = bs.unfiledBookmarksFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.params["parent"] = this._orphanFolderId;
|
stmt.params.parent = this._orphanFolderId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -578,12 +578,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that items with an fk have been converted to bookmarks
|
// Check that items with an fk have been converted to bookmarks
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
|
||||||
stmt.params["item_id"] = this._separatorId;
|
stmt.params.item_id = this._separatorId;
|
||||||
stmt.params["type"] = bs.TYPE_BOOKMARK;
|
stmt.params.type = bs.TYPE_BOOKMARK;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["item_id"] = this._folderId;
|
stmt.params.item_id = this._folderId;
|
||||||
stmt.params["type"] = bs.TYPE_BOOKMARK;
|
stmt.params.type = bs.TYPE_BOOKMARK;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -611,13 +611,13 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check valid bookmark
|
// Check valid bookmark
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
|
||||||
stmt.params["item_id"] = this._validBookmarkId;
|
stmt.params.item_id = this._validBookmarkId;
|
||||||
stmt.params["type"] = bs.TYPE_BOOKMARK;
|
stmt.params.type = bs.TYPE_BOOKMARK;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check invalid bookmark has been converted to a folder
|
// Check invalid bookmark has been converted to a folder
|
||||||
stmt.params["item_id"] = this._invalidBookmarkId;
|
stmt.params.item_id = this._invalidBookmarkId;
|
||||||
stmt.params["type"] = bs.TYPE_FOLDER;
|
stmt.params.type = bs.TYPE_FOLDER;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -650,12 +650,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that bookmarks are now children of a real folder (unsorted)
|
// Check that bookmarks are now children of a real folder (unsorted)
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
|
||||||
stmt.params["item_id"] = this._bookmarkId1;
|
stmt.params.item_id = this._bookmarkId1;
|
||||||
stmt.params["parent"] = bs.unfiledBookmarksFolder;
|
stmt.params.parent = bs.unfiledBookmarksFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["item_id"] = this._bookmarkId2;
|
stmt.params.item_id = this._bookmarkId2;
|
||||||
stmt.params["parent"] = bs.unfiledBookmarksFolder;
|
stmt.params.parent = bs.unfiledBookmarksFolder;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -697,8 +697,8 @@ tests.push({
|
||||||
)`
|
)`
|
||||||
);
|
);
|
||||||
for (let i = 0; i < (NUM_BOOKMARKS / 2); i++) {
|
for (let i = 0; i < (NUM_BOOKMARKS / 2); i++) {
|
||||||
stmt.params["parent"] = aParent;
|
stmt.params.parent = aParent;
|
||||||
stmt.params["rand"] = Math.round(Math.random() * (NUM_BOOKMARKS - 1));
|
stmt.params.rand = Math.round(Math.random() * (NUM_BOOKMARKS - 1));
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ tests.push({
|
||||||
FROM moz_bookmarks WHERE parent = :parent
|
FROM moz_bookmarks WHERE parent = :parent
|
||||||
ORDER BY position ASC, ROWID ASC`
|
ORDER BY position ASC, ROWID ASC`
|
||||||
);
|
);
|
||||||
stmt.params["parent"] = aParent;
|
stmt.params.parent = aParent;
|
||||||
while (stmt.executeStep()) {
|
while (stmt.executeStep()) {
|
||||||
aResultArray.push(stmt.row.id);
|
aResultArray.push(stmt.row.id);
|
||||||
print(stmt.row.id + "\t" + stmt.row.position + "\t" +
|
print(stmt.row.id + "\t" + stmt.row.position + "\t" +
|
||||||
|
@ -732,7 +732,7 @@ tests.push({
|
||||||
`SELECT id, position FROM moz_bookmarks WHERE parent = :parent
|
`SELECT id, position FROM moz_bookmarks WHERE parent = :parent
|
||||||
ORDER BY position ASC`
|
ORDER BY position ASC`
|
||||||
);
|
);
|
||||||
stmt.params["parent"] = aParent;
|
stmt.params.parent = aParent;
|
||||||
let pass = true;
|
let pass = true;
|
||||||
while (stmt.executeStep()) {
|
while (stmt.executeStep()) {
|
||||||
print(stmt.row.id + "\t" + stmt.row.position);
|
print(stmt.row.id + "\t" + stmt.row.position);
|
||||||
|
@ -780,19 +780,19 @@ tests.push({
|
||||||
let stmt = mDBConn.createStatement(
|
let stmt = mDBConn.createStatement(
|
||||||
"SELECT title FROM moz_bookmarks WHERE id = :id"
|
"SELECT title FROM moz_bookmarks WHERE id = :id"
|
||||||
);
|
);
|
||||||
stmt.params["id"] = this._untitledTagId;
|
stmt.params.id = this._untitledTagId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
do_check_eq(stmt.row.title, "(notitle)");
|
do_check_eq(stmt.row.title, "(notitle)");
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["id"] = this._untitledFolderId;
|
stmt.params.id = this._untitledFolderId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
do_check_eq(stmt.row.title, "");
|
do_check_eq(stmt.row.title, "");
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["id"] = this._titledTagId;
|
stmt.params.id = this._titledTagId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
do_check_eq(stmt.row.title, "titledTag");
|
do_check_eq(stmt.row.title, "titledTag");
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["id"] = this._titledFolderId;
|
stmt.params.id = this._titledFolderId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
do_check_eq(stmt.row.title, "titledFolder");
|
do_check_eq(stmt.row.title, "titledFolder");
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
|
@ -810,18 +810,18 @@ tests.push({
|
||||||
setup() {
|
setup() {
|
||||||
// Insert favicon entries
|
// Insert favicon entries
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_icons (id, icon_url, fixed_icon_url_hash) VALUES(:favicon_id, :url, hash(fixup_url(:url)))");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_icons (id, icon_url, fixed_icon_url_hash) VALUES(:favicon_id, :url, hash(fixup_url(:url)))");
|
||||||
stmt.params["favicon_id"] = 1;
|
stmt.params.favicon_id = 1;
|
||||||
stmt.params["url"] = "http://www1.mozilla.org/favicon.ico";
|
stmt.params.url = "http://www1.mozilla.org/favicon.ico";
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["favicon_id"] = 2;
|
stmt.params.favicon_id = 2;
|
||||||
stmt.params["url"] = "http://www2.mozilla.org/favicon.ico";
|
stmt.params.url = "http://www2.mozilla.org/favicon.ico";
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Insert orphan page.
|
// Insert orphan page.
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_pages_w_icons (id, page_url, page_url_hash) VALUES(:page_id, :url, hash(:url))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_pages_w_icons (id, page_url, page_url_hash) VALUES(:page_id, :url, hash(:url))");
|
||||||
stmt.params["page_id"] = 99;
|
stmt.params.page_id = 99;
|
||||||
stmt.params["url"] = "http://w99.mozilla.org/";
|
stmt.params.url = "http://w99.mozilla.org/";
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
|
|
||||||
|
@ -832,16 +832,16 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used icon is still there
|
// Check that used icon is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_icons WHERE id = :favicon_id");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_icons WHERE id = :favicon_id");
|
||||||
stmt.params["favicon_id"] = 1;
|
stmt.params.favicon_id = 1;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that unused icon has been removed
|
// Check that unused icon has been removed
|
||||||
stmt.params["favicon_id"] = 2;
|
stmt.params.favicon_id = 2;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Check that the orphan page is gone.
|
// Check that the orphan page is gone.
|
||||||
stmt = mDBConn.createStatement("SELECT id FROM moz_pages_w_icons WHERE id = :page_id");
|
stmt = mDBConn.createStatement("SELECT id FROM moz_pages_w_icons WHERE id = :page_id");
|
||||||
stmt.params["page_id"] = 99;
|
stmt.params.page_id = 99;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -861,10 +861,10 @@ tests.push({
|
||||||
this._placeId = addPlace();
|
this._placeId = addPlace();
|
||||||
// Add a valid visit and an invalid one
|
// Add a valid visit and an invalid one
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_historyvisits(place_id) VALUES (:place_id)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_historyvisits(place_id) VALUES (:place_id)");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["place_id"] = this._invalidPlaceId;
|
stmt.params.place_id = this._invalidPlaceId;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -872,11 +872,11 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that valid visit is still there
|
// Check that valid visit is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_historyvisits WHERE place_id = :place_id");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_historyvisits WHERE place_id = :place_id");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that invalid visit has been removed
|
// Check that invalid visit has been removed
|
||||||
stmt.params["place_id"] = this._invalidPlaceId;
|
stmt.params.place_id = this._invalidPlaceId;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -896,12 +896,12 @@ tests.push({
|
||||||
this._placeId = addPlace();
|
this._placeId = addPlace();
|
||||||
// Add input history entries
|
// Add input history entries
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_inputhistory (place_id, input) VALUES (:place_id, :input)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_inputhistory (place_id, input) VALUES (:place_id, :input)");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
stmt.params["input"] = "moz";
|
stmt.params.input = "moz";
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
stmt.params["place_id"] = this._invalidPlaceId;
|
stmt.params.place_id = this._invalidPlaceId;
|
||||||
stmt.params["input"] = "moz";
|
stmt.params.input = "moz";
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -909,11 +909,11 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that inputhistory on valid place is still there
|
// Check that inputhistory on valid place is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT place_id FROM moz_inputhistory WHERE place_id = :place_id");
|
let stmt = mDBConn.createStatement("SELECT place_id FROM moz_inputhistory WHERE place_id = :place_id");
|
||||||
stmt.params["place_id"] = this._placeId;
|
stmt.params.place_id = this._placeId;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Check that inputhistory on invalid place has gone
|
// Check that inputhistory on invalid place has gone
|
||||||
stmt.params["place_id"] = this._invalidPlaceId;
|
stmt.params.place_id = this._invalidPlaceId;
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
@ -936,17 +936,17 @@ tests.push({
|
||||||
this._bookmarkId = addBookmark(this._placeId);
|
this._bookmarkId = addBookmark(this._placeId);
|
||||||
// Add a used attribute.
|
// Add a used attribute.
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Add an annotation with a nonexistent attribute
|
// Add an annotation with a nonexistent attribute
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, 1337)");
|
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, 1337)");
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -954,12 +954,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used attribute is still there
|
// Check that used attribute is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// check that annotation with valid attribute is still there
|
// check that annotation with valid attribute is still there
|
||||||
stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Check that annotation with bogus attribute has been removed
|
// Check that annotation with bogus attribute has been removed
|
||||||
|
@ -987,17 +987,17 @@ tests.push({
|
||||||
this._bookmarkId = addBookmark(this._placeId);
|
this._bookmarkId = addBookmark(this._placeId);
|
||||||
// Add a used attribute.
|
// Add a used attribute.
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES (:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES (:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
|
||||||
stmt.params["item_id"] = this._bookmarkId;
|
stmt.params.item_id = this._bookmarkId;
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.reset();
|
stmt.reset();
|
||||||
// Add an annotation to a nonexistent item
|
// Add an annotation to a nonexistent item
|
||||||
stmt.params["item_id"] = this._invalidBookmarkId;
|
stmt.params.item_id = this._invalidBookmarkId;
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -1005,12 +1005,12 @@ tests.push({
|
||||||
check() {
|
check() {
|
||||||
// Check that used attribute is still there
|
// Check that used attribute is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// check that annotation with valid attribute is still there
|
// check that annotation with valid attribute is still there
|
||||||
stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
|
||||||
stmt.params["anno"] = this._usedItemAttribute;
|
stmt.params.anno = this._usedItemAttribute;
|
||||||
do_check_true(stmt.executeStep());
|
do_check_true(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
// Check that an annotation to a nonexistent page has been removed
|
// Check that an annotation to a nonexistent page has been removed
|
||||||
|
@ -1033,9 +1033,9 @@ tests.push({
|
||||||
setup() {
|
setup() {
|
||||||
// Insert 2 keywords
|
// Insert 2 keywords
|
||||||
let stmt = mDBConn.createStatement("INSERT INTO moz_keywords (id, keyword, place_id) VALUES(:id, :keyword, :place_id)");
|
let stmt = mDBConn.createStatement("INSERT INTO moz_keywords (id, keyword, place_id) VALUES(:id, :keyword, :place_id)");
|
||||||
stmt.params["id"] = 1;
|
stmt.params.id = 1;
|
||||||
stmt.params["keyword"] = "unused";
|
stmt.params.keyword = "unused";
|
||||||
stmt.params["place_id"] = 100;
|
stmt.params.place_id = 100;
|
||||||
stmt.execute();
|
stmt.execute();
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
},
|
},
|
||||||
|
@ -1044,7 +1044,7 @@ tests.push({
|
||||||
// Check that "used" keyword is still there
|
// Check that "used" keyword is still there
|
||||||
let stmt = mDBConn.createStatement("SELECT id FROM moz_keywords WHERE keyword = :keyword");
|
let stmt = mDBConn.createStatement("SELECT id FROM moz_keywords WHERE keyword = :keyword");
|
||||||
// Check that "unused" keyword has gone
|
// Check that "unused" keyword has gone
|
||||||
stmt.params["keyword"] = "unused";
|
stmt.params.keyword = "unused";
|
||||||
do_check_false(stmt.executeStep());
|
do_check_false(stmt.executeStep());
|
||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ XPCOMUtils.defineLazyGetter(this, "Readability", function() {
|
||||||
let scope = {};
|
let scope = {};
|
||||||
scope.dump = this.dump;
|
scope.dump = this.dump;
|
||||||
Services.scriptloader.loadSubScript("resource://gre/modules/reader/Readability.js", scope);
|
Services.scriptloader.loadSubScript("resource://gre/modules/reader/Readability.js", scope);
|
||||||
return scope["Readability"];
|
return scope.Readability;
|
||||||
});
|
});
|
||||||
|
|
||||||
const gIsFirefoxDesktop = Services.appinfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
const gIsFirefoxDesktop = Services.appinfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||||
|
|
|
@ -14,7 +14,6 @@ module.exports = {
|
||||||
}],
|
}],
|
||||||
curly: ["error", "all"],
|
curly: ["error", "all"],
|
||||||
"dot-location": ["error", "property"],
|
"dot-location": ["error", "property"],
|
||||||
"dot-notation": "error",
|
|
||||||
"generator-star-spacing": ["error", "after"],
|
"generator-star-spacing": ["error", "after"],
|
||||||
indent: ["error", 2, {
|
indent: ["error", 2, {
|
||||||
SwitchCase: 1,
|
SwitchCase: 1,
|
||||||
|
|
|
@ -2196,7 +2196,7 @@ Engine.prototype = {
|
||||||
appPath = appPath.spec;
|
appPath = appPath.spec;
|
||||||
let spec = uri.spec;
|
let spec = uri.spec;
|
||||||
if (spec.includes(appPath)) {
|
if (spec.includes(appPath)) {
|
||||||
let appURI = Services.io.newFileURI(getDir(knownDirs["app"]));
|
let appURI = Services.io.newFileURI(getDir(knownDirs.app));
|
||||||
uri = Services.io.newURI(spec.replace(appPath, appURI.spec));
|
uri = Services.io.newURI(spec.replace(appPath, appURI.spec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3636,7 +3636,7 @@ SearchService.prototype = {
|
||||||
if (!("visibleDefaultEngines" in searchSettings[region])) {
|
if (!("visibleDefaultEngines" in searchSettings[region])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (let engine of searchSettings[region]["visibleDefaultEngines"]) {
|
for (let engine of searchSettings[region].visibleDefaultEngines) {
|
||||||
jarNames.add(engine);
|
jarNames.add(engine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3667,7 +3667,7 @@ SearchService.prototype = {
|
||||||
if (!region || !(region in searchSettings)) {
|
if (!region || !(region in searchSettings)) {
|
||||||
region = "default";
|
region = "default";
|
||||||
}
|
}
|
||||||
engineNames = searchSettings[region]["visibleDefaultEngines"];
|
engineNames = searchSettings[region].visibleDefaultEngines;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any engine names that are supposed to be ignored.
|
// Remove any engine names that are supposed to be ignored.
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче