зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 21b69215ab80 (bug 1316870) for forthcoming merge conflicts
This commit is contained in:
Родитель
c8796d19d6
Коммит
8304bb1bd5
|
@ -10,7 +10,6 @@ module.exports = {
|
|||
"vars": "local",
|
||||
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
|
||||
"args": "none",
|
||||
}],
|
||||
"no-shadow": "error"
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
|
|
@ -259,7 +259,7 @@
|
|||
|
||||
if (err == "sslv3Used") {
|
||||
document.getElementById("learnMoreContainer").style.display = "block";
|
||||
let learnMoreLink = document.getElementById("learnMoreLink");
|
||||
var learnMoreLink = document.getElementById("learnMoreLink");
|
||||
learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
|
||||
document.body.className = "certerror";
|
||||
}
|
||||
|
@ -305,7 +305,7 @@
|
|||
// Pinning errors are of type nssFailure2
|
||||
if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
|
||||
document.getElementById("learnMoreContainer").style.display = "block";
|
||||
let learnMoreLink = document.getElementById("learnMoreLink");
|
||||
var learnMoreLink = document.getElementById("learnMoreLink");
|
||||
// nssFailure2 also gets us other non-overrideable errors. Choose
|
||||
// a "learn more" link based on description:
|
||||
if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
|
||||
|
@ -324,10 +324,9 @@
|
|||
checkbox.checked = true;
|
||||
}
|
||||
|
||||
checkbox.addEventListener("change", function(changeEvt) {
|
||||
checkbox.addEventListener("change", function(evt) {
|
||||
var event = new CustomEvent("AboutNetErrorSetAutomatic",
|
||||
{bubbles: true,
|
||||
detail: changeEvt.target.checked});
|
||||
{bubbles:true, detail:evt.target.checked});
|
||||
document.dispatchEvent(event);
|
||||
}, false);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ function log(msg) {
|
|||
// dump("FXA: " + msg + "\n");
|
||||
}
|
||||
|
||||
function error(msg) {
|
||||
console.log("Firefox Account Error: " + msg + "\n");
|
||||
}
|
||||
|
||||
function getPreviousAccountNameHash() {
|
||||
try {
|
||||
return Services.prefs.getComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString).data;
|
||||
|
|
|
@ -38,10 +38,10 @@ var healthReportWrapper = {
|
|||
|
||||
updatePrefState: function () {
|
||||
try {
|
||||
let prefsObj = {
|
||||
let prefs = {
|
||||
enabled: MozSelfSupport.healthReportDataSubmissionEnabled,
|
||||
};
|
||||
healthReportWrapper.injectData("prefs", prefsObj);
|
||||
healthReportWrapper.injectData("prefs", prefs);
|
||||
}
|
||||
catch (ex) {
|
||||
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PREFS_FAILED);
|
||||
|
|
|
@ -149,12 +149,12 @@ function ensureSnippetsMapThen(aCallback)
|
|||
openRequest.onsuccess = function (event) {
|
||||
let db = event.target.result;
|
||||
|
||||
db.onerror = function () {
|
||||
db.onerror = function (event) {
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
db.onversionchange = function (versionChangeEvent) {
|
||||
versionChangeEvent.target.close();
|
||||
db.onversionchange = function (event) {
|
||||
event.target.close();
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
|
@ -169,12 +169,12 @@ function ensureSnippetsMapThen(aCallback)
|
|||
return;
|
||||
}
|
||||
|
||||
cursorRequest.onerror = function () {
|
||||
cursorRequest.onerror = function (event) {
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
cursorRequest.onsuccess = function(cursorRequestEvent) {
|
||||
let cursor = cursorRequestEvent.target.result;
|
||||
cursorRequest.onsuccess = function(event) {
|
||||
let cursor = event.target.result;
|
||||
|
||||
// Populate the cache from the persistent storage.
|
||||
if (cursor) {
|
||||
|
@ -283,7 +283,7 @@ function loadSnippets()
|
|||
// Even if fetching should fail we don't want to spam the server, thus
|
||||
// set the last update time regardless its results. Will retry tomorrow.
|
||||
gSnippetsMap.set("snippets-last-update", Date.now());
|
||||
xhr.onloadend = function () {
|
||||
xhr.onloadend = function (event) {
|
||||
if (xhr.status == 200) {
|
||||
gSnippetsMap.set("snippets", xhr.responseText);
|
||||
gSnippetsMap.set("snippets-cached-version", currentVersion);
|
||||
|
|
|
@ -132,12 +132,10 @@ const gXPInstallObserver = {
|
|||
container.appendChild(name);
|
||||
|
||||
if (someUnsigned && install.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
|
||||
let unsignedLabel = document.createElement("label");
|
||||
unsignedLabel.setAttribute("value",
|
||||
gNavigatorBundle.getString("addonInstall.unsigned"));
|
||||
unsignedLabel.setAttribute("class",
|
||||
"addon-install-confirmation-unsigned");
|
||||
container.appendChild(unsignedLabel);
|
||||
let unsigned = document.createElement("label");
|
||||
unsigned.setAttribute("value", gNavigatorBundle.getString("addonInstall.unsigned"));
|
||||
unsigned.setAttribute("class", "addon-install-confirmation-unsigned");
|
||||
container.appendChild(unsigned);
|
||||
}
|
||||
|
||||
addonList.appendChild(container);
|
||||
|
@ -196,6 +194,7 @@ const gXPInstallObserver = {
|
|||
acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
|
||||
|
||||
if (height) {
|
||||
let notification = document.getElementById("addon-install-confirmation-notification");
|
||||
notification.style.minHeight = height + "px";
|
||||
}
|
||||
|
||||
|
|
|
@ -377,9 +377,10 @@ var gFxAccounts = {
|
|||
const fragment = document.createDocumentFragment();
|
||||
|
||||
const onTargetDeviceCommand = (event) => {
|
||||
let clients = event.target.getAttribute("clientId") ?
|
||||
[event.target.getAttribute("clientId")] :
|
||||
this.remoteClients.map(client => client.id);
|
||||
const clientId = event.target.getAttribute("clientId");
|
||||
const clients = clientId
|
||||
? [clientId]
|
||||
: this.remoteClients.map(client => client.id);
|
||||
|
||||
clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
|
||||
}
|
||||
|
|
|
@ -134,9 +134,9 @@ var gGestureSupport = {
|
|||
let isLatched = false;
|
||||
|
||||
// Create the update function here to capture closure state
|
||||
this._doUpdate = function GS__doUpdate(updateEvent) {
|
||||
this._doUpdate = function GS__doUpdate(aEvent) {
|
||||
// Update the offset with new event data
|
||||
offset += updateEvent.delta;
|
||||
offset += aEvent.delta;
|
||||
|
||||
// Check if the cumulative deltas exceed the threshold
|
||||
if (Math.abs(offset) > aPref["threshold"]) {
|
||||
|
@ -145,7 +145,7 @@ var gGestureSupport = {
|
|||
// initial motion; or we're latched and going the opposite way
|
||||
let sameDir = (latchDir ^ offset) >= 0;
|
||||
if (!aPref["latched"] || (isLatched ^ sameDir)) {
|
||||
this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
||||
this._doAction(aEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
||||
|
||||
// We must be getting latched or leaving it, so just toggle
|
||||
isLatched = !isLatched;
|
||||
|
@ -242,8 +242,8 @@ var gGestureSupport = {
|
|||
this._doEnd = function GS__doEnd(aEvent) {
|
||||
gHistorySwipeAnimation.swipeEndEventReceived();
|
||||
|
||||
this._doUpdate = function () {};
|
||||
this._doEnd = function () {};
|
||||
this._doUpdate = function (aEvent) {};
|
||||
this._doEnd = function (aEvent) {};
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ var RefreshBlocker = {
|
|||
let buttons = [{
|
||||
label: refreshButtonText,
|
||||
accessKey: refreshButtonAccesskey,
|
||||
callback: function () {
|
||||
callback: function (notification, button) {
|
||||
if (browser.messageManager) {
|
||||
browser.messageManager.sendAsyncMessage("RefreshBlocker:Refresh", data);
|
||||
}
|
||||
|
|
|
@ -426,10 +426,10 @@ var gSyncUI = {
|
|||
formatLastSyncDate: function(date) {
|
||||
let dateFormat;
|
||||
let sixDaysAgo = (() => {
|
||||
let tempDate = new Date();
|
||||
tempDate.setDate(tempDate.getDate() - 6);
|
||||
tempDate.setHours(0, 0, 0, 0);
|
||||
return tempDate;
|
||||
let date = new Date();
|
||||
date.setDate(date.getDate() - 6);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
return date;
|
||||
})();
|
||||
// It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
|
||||
if (date < sixDaysAgo) {
|
||||
|
|
|
@ -757,11 +757,11 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
|
|||
return;
|
||||
|
||||
let onLookupComplete = (request, record, status) => {
|
||||
let browserRef = weakBrowser.get();
|
||||
if (!Components.isSuccessCode(status) || !browserRef)
|
||||
let browser = weakBrowser.get();
|
||||
if (!Components.isSuccessCode(status) || !browser)
|
||||
return;
|
||||
|
||||
let currentURI = browserRef.currentURI;
|
||||
let currentURI = browser.currentURI;
|
||||
// If we're in case (3) (see above), don't show an info bar.
|
||||
if (!currentURI.equals(previousURI) &&
|
||||
!currentURI.equals(preferredURI)) {
|
||||
|
@ -769,7 +769,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
|
|||
}
|
||||
|
||||
// show infobar offering to visit the host
|
||||
let notificationBox = gBrowser.getNotificationBox(browserRef);
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
if (notificationBox.getNotificationWithValue("keyword-uri-fixup"))
|
||||
return;
|
||||
|
||||
|
@ -1238,6 +1238,7 @@ var gBrowserInit = {
|
|||
// If the initial browser is remote, in order to optimize for first paint,
|
||||
// we'll defer switching focus to that browser until it has painted.
|
||||
let focusedElement = document.commandDispatcher.focusedElement;
|
||||
let mm = window.messageManager;
|
||||
mm.addMessageListener("Browser:FirstPaint", function onFirstPaint() {
|
||||
mm.removeMessageListener("Browser:FirstPaint", onFirstPaint);
|
||||
// If focus didn't move while we were waiting for first paint, we're okay
|
||||
|
@ -3592,7 +3593,7 @@ const BrowserSearch = {
|
|||
win.BrowserSearch.webSearch();
|
||||
} else {
|
||||
// If there are no open browser windows, open a new one
|
||||
var observer = function(subject, topic, data) {
|
||||
var observer = function observer(subject, topic, data) {
|
||||
if (subject == win) {
|
||||
BrowserSearch.webSearch();
|
||||
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
|
||||
|
@ -4493,12 +4494,12 @@ var XULBrowserWindow = {
|
|||
gTabletModePageCounter.inc();
|
||||
|
||||
// Utility functions for disabling find
|
||||
var shouldDisableFind = function(aDocument) {
|
||||
var shouldDisableFind = function shouldDisableFind(aDocument) {
|
||||
let docElt = aDocument.documentElement;
|
||||
return docElt && docElt.getAttribute("disablefastfind") == "true";
|
||||
}
|
||||
|
||||
var disableFindCommands = function(aDisable) {
|
||||
var disableFindCommands = function disableFindCommands(aDisable) {
|
||||
let findCommands = [document.getElementById("cmd_find"),
|
||||
document.getElementById("cmd_findAgain"),
|
||||
document.getElementById("cmd_findPrevious")];
|
||||
|
@ -4510,7 +4511,7 @@ var XULBrowserWindow = {
|
|||
}
|
||||
}
|
||||
|
||||
var onContentRSChange = function(e) {
|
||||
var onContentRSChange = function onContentRSChange(e) {
|
||||
if (e.target.readyState != "interactive" && e.target.readyState != "complete")
|
||||
return;
|
||||
|
||||
|
@ -6033,8 +6034,8 @@ var OfflineApps = {
|
|||
label: gNavigatorBundle.getString("offlineApps.allow"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
|
||||
callback: function() {
|
||||
for (let [ciBrowser, ciDocId, ciUri] of notification.options.controlledItems) {
|
||||
OfflineApps.allowSite(ciBrowser, ciDocId, ciUri);
|
||||
for (let [browser, docId, uri] of notification.options.controlledItems) {
|
||||
OfflineApps.allowSite(browser, docId, uri);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -6042,8 +6043,8 @@ var OfflineApps = {
|
|||
label: gNavigatorBundle.getString("offlineApps.never"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.neverAccessKey"),
|
||||
callback: function() {
|
||||
for (let [, , ciUri] of notification.options.controlledItems) {
|
||||
OfflineApps.disallowSite(ciUri);
|
||||
for (let [, , uri] of notification.options.controlledItems) {
|
||||
OfflineApps.disallowSite(uri);
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
@ -6363,7 +6364,7 @@ function BrowserOpenAddonsMgr(aView) {
|
|||
let emWindow;
|
||||
let browserWindow;
|
||||
|
||||
var receivePong = function(aSubject, aTopic, aData) {
|
||||
var receivePong = function receivePong(aSubject, aTopic, aData) {
|
||||
let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
|
|
|
@ -1147,8 +1147,8 @@ var PageInfoListener = {
|
|||
// multiple background images.
|
||||
let mediaItems = [];
|
||||
|
||||
let addImage = (url, type, alt, el, isBg) => {
|
||||
let element = this.serializeElementInfo(document, url, type, alt, el, isBg);
|
||||
let addImage = (url, type, alt, elem, isBg) => {
|
||||
let element = this.serializeElementInfo(document, url, type, alt, elem, isBg);
|
||||
mediaItems.push([url, type, alt, element, isBg]);
|
||||
};
|
||||
|
||||
|
|
|
@ -725,9 +725,9 @@ function saveMedia()
|
|||
var tree = document.getElementById("imagetree");
|
||||
var rowArray = getSelectedRows(tree);
|
||||
if (rowArray.length == 1) {
|
||||
let row = rowArray[0];
|
||||
let item = gImageView.data[row][COL_IMAGE_NODE];
|
||||
let url = gImageView.data[row][COL_IMAGE_ADDRESS];
|
||||
var row = rowArray[0];
|
||||
var item = gImageView.data[row][COL_IMAGE_NODE];
|
||||
var url = gImageView.data[row][COL_IMAGE_ADDRESS];
|
||||
|
||||
if (url) {
|
||||
var titleKey = "SaveImageTitle";
|
||||
|
@ -750,11 +750,11 @@ function saveMedia()
|
|||
};
|
||||
|
||||
for (var i = 0; i < rowArray.length; i++) {
|
||||
let v = rowArray[i];
|
||||
let dir = aDirectory.clone();
|
||||
let item = gImageView.data[v][COL_IMAGE_NODE];
|
||||
let uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
|
||||
let uri = makeURI(uriString);
|
||||
var v = rowArray[i];
|
||||
var dir = aDirectory.clone();
|
||||
var item = gImageView.data[v][COL_IMAGE_NODE];
|
||||
var uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
|
||||
var uri = makeURI(uriString);
|
||||
|
||||
try {
|
||||
uri.QueryInterface(Components.interfaces.nsIURL);
|
||||
|
|
|
@ -825,8 +825,8 @@ var gSyncSetup = {
|
|||
uri = Weave.Utils.makeURI("https://" + val);
|
||||
|
||||
if (uri && this._settingUpNew) {
|
||||
function isValid(validUri) {
|
||||
Weave.Service.serverURL = validUri.spec;
|
||||
function isValid(uri) {
|
||||
Weave.Service.serverURL = uri.spec;
|
||||
let check = Weave.Service.checkAccount("a");
|
||||
return (check == "available" || check == "notAvailable");
|
||||
}
|
||||
|
|
|
@ -4745,7 +4745,7 @@
|
|||
<body><![CDATA[
|
||||
let browser;
|
||||
switch (aTopic) {
|
||||
case "live-resize-start": {
|
||||
case "live-resize-start":
|
||||
browser = this.mCurrentTab.linkedBrowser;
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
if (fl && fl.tabParent && !this.mActiveResizeDisplayportSuppression) {
|
||||
|
@ -4753,8 +4753,7 @@
|
|||
this.mActiveResizeDisplayportSuppression = browser;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "live-resize-end": {
|
||||
case "live-resize-end":
|
||||
browser = this.mActiveResizeDisplayportSuppression;
|
||||
if (browser) {
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
|
@ -4764,12 +4763,10 @@
|
|||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "nsPref:changed": {
|
||||
case "nsPref:changed":
|
||||
// This is the only pref observed.
|
||||
this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
|
||||
break;
|
||||
}
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -5756,7 +5753,7 @@
|
|||
++mid > high)
|
||||
break;
|
||||
let boxObject = tabs[mid].boxObject;
|
||||
screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
|
||||
let screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
|
||||
if (screenX > tabCenter) {
|
||||
high = mid - 1;
|
||||
} else if (screenX + boxObject.width < tabCenter) {
|
||||
|
|
|
@ -16,11 +16,10 @@ add_task(function* test_notificationClose() {
|
|||
|
||||
yield PlacesTestUtils.addVisits(notificationURI);
|
||||
let faviconURI = yield new Promise(resolve => {
|
||||
let uri =
|
||||
makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
|
||||
PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, uri,
|
||||
let faviconURI = makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
|
||||
PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, faviconURI,
|
||||
true, PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
|
||||
(uriResult) => resolve(uriResult),
|
||||
(faviconURI, iconSize, iconData, mimeType) => resolve(faviconURI),
|
||||
Services.scriptSecurityManager.getSystemPrincipal());
|
||||
});
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ add_task(function* test_notificationPreventDefaultAndSwitchTabs() {
|
|||
|
||||
// First, show a notification that will be have the tab-switching prevented.
|
||||
function promiseNotificationEvent(evt) {
|
||||
return ContentTask.spawn(aBrowser, evt, function* (contentEvt) {
|
||||
return ContentTask.spawn(aBrowser, evt, function* (evt) {
|
||||
return yield new Promise(resolve => {
|
||||
let contentNotification = content.wrappedJSObject._notification;
|
||||
contentNotification.addEventListener(contentEvt, function l(event) {
|
||||
contentNotification.removeEventListener(contentEvt, l);
|
||||
let notification = content.wrappedJSObject._notification;
|
||||
notification.addEventListener(evt, function l(event) {
|
||||
notification.removeEventListener(evt, l);
|
||||
resolve({ defaultPrevented: event.defaultPrevented });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -42,9 +42,9 @@ function promiseWindowClosed(window) {
|
|||
* rejected after the requested number of miliseconds.
|
||||
*/
|
||||
function openNotification(aBrowser, fn, timeout) {
|
||||
return ContentTask.spawn(aBrowser, [fn, timeout], function* ([contentFn, contentTimeout]) {
|
||||
return ContentTask.spawn(aBrowser, { fn, timeout }, function* ({ fn, timeout }) {
|
||||
let win = content.wrappedJSObject;
|
||||
let notification = win[contentFn]();
|
||||
let notification = win[fn]();
|
||||
win._notification = notification;
|
||||
yield new Promise((resolve, reject) => {
|
||||
function listener() {
|
||||
|
@ -54,11 +54,11 @@ function openNotification(aBrowser, fn, timeout) {
|
|||
|
||||
notification.addEventListener("show", listener);
|
||||
|
||||
if (contentTimeout) {
|
||||
if (timeout) {
|
||||
content.setTimeout(() => {
|
||||
notification.removeEventListener("show", listener);
|
||||
reject("timed out");
|
||||
}, contentTimeout);
|
||||
}, timeout);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -509,7 +509,7 @@ function whenSearchInitDone() {
|
|||
* Can be any of("blank"|"classic"|"enhanced")
|
||||
*/
|
||||
function customizeNewTabPage(aTheme) {
|
||||
return ContentTask.spawn(gWindow.gBrowser.selectedBrowser, aTheme, function*(contentTheme) {
|
||||
return ContentTask.spawn(gWindow.gBrowser.selectedBrowser, aTheme, function*(aTheme) {
|
||||
|
||||
let document = content.document;
|
||||
let panel = document.getElementById("newtab-customize-panel");
|
||||
|
@ -520,7 +520,7 @@ function customizeNewTabPage(aTheme) {
|
|||
let options = {attributes: true, oldValue: true};
|
||||
let observer = new content.MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
document.getElementById("newtab-customize-" + contentTheme).click();
|
||||
document.getElementById("newtab-customize-" + aTheme).click();
|
||||
observer.disconnect();
|
||||
if (opened == panel.hasAttribute("open")) {
|
||||
resolve();
|
||||
|
|
|
@ -66,8 +66,8 @@ function test() {
|
|||
|
||||
// The first test plugin is CtP and the second test plugin is enabled.
|
||||
function testPart1a() {
|
||||
let testElement = gTestBrowser.contentDocument.getElementById("test");
|
||||
let objLoadingContent = testElement.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
let test = gTestBrowser.contentDocument.getElementById("test");
|
||||
let objLoadingContent = test.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!objLoadingContent.activated, "part 1a: Test plugin should not be activated");
|
||||
let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA");
|
||||
objLoadingContent = secondtest.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
|
@ -97,9 +97,9 @@ function testPart1b() {
|
|||
|
||||
// Now, the Test plugin should be allowed, and the Test2 plugin should be CtP
|
||||
function testPart2() {
|
||||
let testElement = gTestBrowser.contentDocument.getElementById("test").
|
||||
let test = gTestBrowser.contentDocument.getElementById("test").
|
||||
QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(testElement.activated, "part 2: Test plugin should be activated");
|
||||
ok(test.activated, "part 2: Test plugin should be activated");
|
||||
|
||||
let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA").
|
||||
QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
|
@ -126,10 +126,10 @@ function testPart2() {
|
|||
|
||||
// Now, all the things should be blocked
|
||||
function testPart3() {
|
||||
let testElement = gTestBrowser.contentDocument.getElementById("test").
|
||||
let test = gTestBrowser.contentDocument.getElementById("test").
|
||||
QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
ok(!testElement.activated, "part 3: Test plugin should not be activated");
|
||||
is(testElement.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_DISABLED,
|
||||
ok(!test.activated, "part 3: Test plugin should not be activated");
|
||||
is(test.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_DISABLED,
|
||||
"part 3: Test plugin should be marked as PLUGIN_DISABLED");
|
||||
|
||||
let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA").
|
||||
|
|
|
@ -49,7 +49,7 @@ const CRASHED_MESSAGE = "BrowserPlugins:NPAPIPluginProcessCrashed";
|
|||
* the crash reporter state.
|
||||
*/
|
||||
function preparePlugin(browser, pluginFallbackState) {
|
||||
return ContentTask.spawn(browser, pluginFallbackState, function* (contentPluginFallbackState) {
|
||||
return ContentTask.spawn(browser, pluginFallbackState, function* (pluginFallbackState) {
|
||||
let plugin = content.document.getElementById("plugin");
|
||||
plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
// CRASH_URL will load a plugin that crashes immediately. We
|
||||
|
@ -69,7 +69,7 @@ function preparePlugin(browser, pluginFallbackState) {
|
|||
// this XPCOM object. Probably because I've got chrome privledges.
|
||||
Object.defineProperty(plugin, "pluginFallbackType", {
|
||||
get: function() {
|
||||
return contentPluginFallbackState;
|
||||
return pluginFallbackState;
|
||||
}
|
||||
});
|
||||
return plugin.runID;
|
||||
|
|
|
@ -480,8 +480,9 @@ add_task(function* () {
|
|||
"Test 21c, plugin " + args.id + " should have click-to-play overlay with zero dims");
|
||||
});
|
||||
|
||||
let pluginInfoTmp = yield promiseForPluginInfo(id);
|
||||
ok(!pluginInfoTmp.activated, "Test 21c, Plugin with id=" + id + " should not be activated");
|
||||
|
||||
let pluginInfo = yield promiseForPluginInfo(id);
|
||||
ok(!pluginInfo.activated, "Test 21c, Plugin with id=" + id + " should not be activated");
|
||||
}
|
||||
|
||||
centerAction = null;
|
||||
|
@ -525,8 +526,8 @@ add_task(function* () {
|
|||
"Test 21d, plugin " + args.id + " should have click-to-play overlay with zero dims");
|
||||
});
|
||||
|
||||
let pluginInfoTmp = yield promiseForPluginInfo(id);
|
||||
ok(pluginInfoTmp.activated, "Test 21d, Plugin with id=" + id + " should not be activated");
|
||||
let pluginInfo = yield promiseForPluginInfo(id);
|
||||
ok(pluginInfo.activated, "Test 21d, Plugin with id=" + id + " should not be activated");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -165,8 +165,8 @@ function getTestPluginEnabledState(pluginName) {
|
|||
// Returns a promise for nsIObjectLoadingContent props data.
|
||||
function promiseForPluginInfo(aId, aBrowser) {
|
||||
let browser = aBrowser || gTestBrowser;
|
||||
return ContentTask.spawn(browser, aId, function* (contentId) {
|
||||
let plugin = content.document.getElementById(contentId);
|
||||
return ContentTask.spawn(browser, aId, function* (aId) {
|
||||
let plugin = content.document.getElementById(aId);
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||
throw new Error("no plugin found");
|
||||
return {
|
||||
|
@ -182,8 +182,8 @@ function promiseForPluginInfo(aId, aBrowser) {
|
|||
// playPlugin() method.
|
||||
function promisePlayObject(aId, aBrowser) {
|
||||
let browser = aBrowser || gTestBrowser;
|
||||
return ContentTask.spawn(browser, aId, function* (contentId) {
|
||||
let plugin = content.document.getElementById(contentId);
|
||||
return ContentTask.spawn(browser, aId, function* (aId) {
|
||||
let plugin = content.document.getElementById(aId);
|
||||
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
objLoadingContent.playPlugin();
|
||||
});
|
||||
|
@ -191,8 +191,8 @@ function promisePlayObject(aId, aBrowser) {
|
|||
|
||||
function promiseCrashObject(aId, aBrowser) {
|
||||
let browser = aBrowser || gTestBrowser;
|
||||
return ContentTask.spawn(browser, aId, function* (contentId) {
|
||||
let plugin = content.document.getElementById(contentId);
|
||||
return ContentTask.spawn(browser, aId, function* (aId) {
|
||||
let plugin = content.document.getElementById(aId);
|
||||
Components.utils.waiveXrays(plugin).crash();
|
||||
});
|
||||
}
|
||||
|
@ -200,8 +200,8 @@ function promiseCrashObject(aId, aBrowser) {
|
|||
// Return a promise and call the plugin's getObjectValue() method.
|
||||
function promiseObjectValueResult(aId, aBrowser) {
|
||||
let browser = aBrowser || gTestBrowser;
|
||||
return ContentTask.spawn(browser, aId, function* (contentId) {
|
||||
let plugin = content.document.getElementById(contentId);
|
||||
return ContentTask.spawn(browser, aId, function* (aId) {
|
||||
let plugin = content.document.getElementById(aId);
|
||||
return Components.utils.waiveXrays(plugin).getObjectValue();
|
||||
});
|
||||
}
|
||||
|
@ -209,8 +209,8 @@ function promiseObjectValueResult(aId, aBrowser) {
|
|||
// Return a promise and reload the target plugin in the page
|
||||
function promiseReloadPlugin(aId, aBrowser) {
|
||||
let browser = aBrowser || gTestBrowser;
|
||||
return ContentTask.spawn(browser, aId, function* (contentId) {
|
||||
let plugin = content.document.getElementById(contentId);
|
||||
return ContentTask.spawn(browser, aId, function* (aId) {
|
||||
let plugin = content.document.getElementById(aId);
|
||||
plugin.src = plugin.src;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -133,9 +133,9 @@ var tests = [
|
|||
yield whenDelayedStartupFinished(win);
|
||||
|
||||
yield new Promise(resolve => {
|
||||
let callback = notification.options.eventCallback;
|
||||
let originalCallback = notification.options.eventCallback;
|
||||
notification.options.eventCallback = function (eventName) {
|
||||
callback(eventName);
|
||||
originalCallback(eventName);
|
||||
if (eventName == "shown") {
|
||||
resolve();
|
||||
}
|
||||
|
|
|
@ -36,9 +36,9 @@ function promiseTopicObserved(topic)
|
|||
{
|
||||
let deferred = Promise.defer();
|
||||
info("Waiting for observer topic " + topic);
|
||||
Services.obs.addObserver(function PTO_observe(obsSubject, obsTopic, obsData) {
|
||||
Services.obs.removeObserver(PTO_observe, obsTopic);
|
||||
deferred.resolve([obsSubject, obsData]);
|
||||
Services.obs.addObserver(function PTO_observe(subject, topic, data) {
|
||||
Services.obs.removeObserver(PTO_observe, topic);
|
||||
deferred.resolve([subject, data]);
|
||||
}, topic, false);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
// Selects "open link in new container tab" from the context menu.
|
||||
|
||||
function getReferrerTest(aTestNumber) {
|
||||
let testCase = _referrerTests[aTestNumber];
|
||||
if (testCase) {
|
||||
let test = _referrerTests[aTestNumber];
|
||||
if (test) {
|
||||
// We want all the referrer tests to fail!
|
||||
testCase.result = "";
|
||||
test.result = "";
|
||||
}
|
||||
|
||||
return testCase;
|
||||
return test;
|
||||
}
|
||||
|
||||
function startNewTabTestCase(aTestNumber) {
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
// Output: we have no referrer.
|
||||
|
||||
function getReferrerTest(aTestNumber) {
|
||||
let testCase = _referrerTests[aTestNumber];
|
||||
if (testCase) {
|
||||
let test = _referrerTests[aTestNumber];
|
||||
if (test) {
|
||||
// We want all the referrer tests to fail!
|
||||
testCase.result = "";
|
||||
test.result = "";
|
||||
}
|
||||
|
||||
return testCase;
|
||||
return test;
|
||||
}
|
||||
|
||||
function startNewTabTestCase(aTestNumber) {
|
||||
|
|
|
@ -79,14 +79,14 @@ function test()
|
|||
});
|
||||
|
||||
Task.spawn(function* () {
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
|
||||
// Create a tab to run the test.
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
|
||||
// Add an event handler to modify the snippets map once it's ready.
|
||||
let snippetsPromise = promiseSetupSnippetsMap(tab, testCase.snippet);
|
||||
let snippetsPromise = promiseSetupSnippetsMap(tab, test.snippet);
|
||||
|
||||
// Start loading about:home and wait for it to complete, snippets should be loaded
|
||||
yield promiseTabLoadEvent(tab, "about:home", "AboutHomeLoadSnippetsCompleted");
|
||||
|
@ -100,7 +100,7 @@ function test()
|
|||
});
|
||||
|
||||
yield new Promise(resolve => {
|
||||
activateProvider(tab, testCase.panel).then(() => {
|
||||
activateProvider(tab, test.panel).then(() => {
|
||||
checkSocialUI();
|
||||
SocialService.uninstallProvider("https://example.com", function () {
|
||||
info("provider uninstalled");
|
||||
|
|
|
@ -12,10 +12,10 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
|||
|
||||
function promiseObserverNotified(aTopic) {
|
||||
return new Promise(resolve => {
|
||||
Services.obs.addObserver(function onNotification(subject, topic, data) {
|
||||
dump("notification promised " + topic);
|
||||
Services.obs.removeObserver(onNotification, topic);
|
||||
TestUtils.executeSoon(() => resolve({subject, data}));
|
||||
Services.obs.addObserver(function onNotification(aSubject, aTopic, aData) {
|
||||
dump("notification promised "+aTopic);
|
||||
Services.obs.removeObserver(onNotification, aTopic);
|
||||
TestUtils.executeSoon(() => resolve({subject: aSubject, data: aData}));
|
||||
}, aTopic, false);
|
||||
});
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ function runSocialTestWithProvider(manifest, callback, finishcallback) {
|
|||
function removeAddedProviders(cleanup) {
|
||||
manifests.forEach(function (m) {
|
||||
// If we're "cleaning up", don't call finish when done.
|
||||
let finishCb = cleanup ? function () {} : finishIfDone;
|
||||
let callback = cleanup ? function () {} : finishIfDone;
|
||||
// Similarly, if we're cleaning up, catch exceptions from removeProvider
|
||||
let removeProvider = SocialService.disableProvider.bind(SocialService);
|
||||
if (cleanup) {
|
||||
|
@ -102,7 +102,7 @@ function runSocialTestWithProvider(manifest, callback, finishcallback) {
|
|||
}
|
||||
}
|
||||
}
|
||||
removeProvider(m.origin, finishCb);
|
||||
removeProvider(m.origin, callback);
|
||||
});
|
||||
}
|
||||
function finishSocialTest(cleanup) {
|
||||
|
@ -235,13 +235,13 @@ function ensureFrameLoaded(frame, uri) {
|
|||
// (via browser/base/content/test/browser_bookmark_titles.js)
|
||||
var origProxyType = Services.prefs.getIntPref('network.proxy.type');
|
||||
|
||||
function toggleOfflineStatus(goOfflineState) {
|
||||
function toggleOfflineStatus(goOffline) {
|
||||
// Bug 968887 fix. when going on/offline, wait for notification before continuing
|
||||
return new Promise(resolve => {
|
||||
if (!goOfflineState) {
|
||||
if (!goOffline) {
|
||||
Services.prefs.setIntPref('network.proxy.type', origProxyType);
|
||||
}
|
||||
if (goOfflineState != Services.io.offline) {
|
||||
if (goOffline != Services.io.offline) {
|
||||
info("initial offline state " + Services.io.offline);
|
||||
let expect = !Services.io.offline;
|
||||
Services.obs.addObserver(function offlineChange(subject, topic, data) {
|
||||
|
@ -254,7 +254,7 @@ function toggleOfflineStatus(goOfflineState) {
|
|||
} else {
|
||||
resolve();
|
||||
}
|
||||
if (goOfflineState) {
|
||||
if (goOffline) {
|
||||
Services.prefs.setIntPref('network.proxy.type', 0);
|
||||
// LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache.
|
||||
Services.cache2.clear();
|
||||
|
|
|
@ -17,9 +17,9 @@ function test() {
|
|||
const phishyUserPassPref = "network.http.phishy-userpass-length";
|
||||
|
||||
function nextTest() {
|
||||
let testCase = tests.shift();
|
||||
if (testCase) {
|
||||
testCase(function () {
|
||||
let test = tests.shift();
|
||||
if (test) {
|
||||
test(function () {
|
||||
executeSoon(nextTest);
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -9,6 +9,7 @@ add_task(function* () {
|
|||
|
||||
registerCleanupFunction(() => {
|
||||
Services.search.currentEngine = originalEngine;
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
Services.search.removeEngine(engine);
|
||||
|
||||
try {
|
||||
|
|
|
@ -10,6 +10,7 @@ add_task(function* () {
|
|||
|
||||
registerCleanupFunction(() => {
|
||||
Services.search.currentEngine = originalEngine;
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
Services.search.removeEngine(engine);
|
||||
|
||||
try {
|
||||
|
|
|
@ -75,9 +75,9 @@ add_task(function* test_disabled_ac() {
|
|||
Preferences.set("browser.urlbar.suggest.openpage", suggestOpenPages);
|
||||
|
||||
Services.search.currentEngine = originalEngine;
|
||||
let mozSearchEngine = Services.search.getEngineByName("MozSearch");
|
||||
if (mozSearchEngine) {
|
||||
Services.search.removeEngine(mozSearchEngine);
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
if (engine) {
|
||||
Services.search.removeEngine(engine);
|
||||
}
|
||||
}
|
||||
registerCleanupFunction(cleanup);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const url = "data:text/html,<body>hi";
|
||||
|
||||
add_task(function*() {
|
||||
const url = "data:text/html,<body>hi";
|
||||
yield* testURL(url, urlEnter);
|
||||
yield* testURL(url, urlClick);
|
||||
});
|
||||
|
|
|
@ -88,7 +88,7 @@ add_task(function* dontTemporarilyShowAboutHome() {
|
|||
win = SessionStore.undoCloseWindow(0);
|
||||
yield windowOpenedPromise;
|
||||
let wpl = {
|
||||
onLocationChange() {
|
||||
onLocationChange(wpl, request, location, flags) {
|
||||
is(win.gURLBar.value, "", "URL bar value should stay empty.");
|
||||
},
|
||||
};
|
||||
|
|
|
@ -145,28 +145,28 @@ var tests = [
|
|||
];
|
||||
|
||||
function nextTest() {
|
||||
let testCase = tests.shift();
|
||||
let test = tests.shift();
|
||||
if (tests.length == 0)
|
||||
runTest(testCase, finish);
|
||||
runTest(test, finish);
|
||||
else
|
||||
runTest(testCase, nextTest);
|
||||
runTest(test, nextTest);
|
||||
}
|
||||
|
||||
function runTest(testCase, cb) {
|
||||
function runTest(test, cb) {
|
||||
function doCheck() {
|
||||
if (testCase.setURL || testCase.loadURL) {
|
||||
gURLBar.valueIsTyped = !!testCase.setURL;
|
||||
is(gURLBar.textValue, testCase.expectedURL, "url bar value set");
|
||||
if (test.setURL || test.loadURL) {
|
||||
gURLBar.valueIsTyped = !!test.setURL;
|
||||
is(gURLBar.textValue, test.expectedURL, "url bar value set");
|
||||
}
|
||||
|
||||
testCopy(testCase.copyVal, testCase.copyExpected, cb);
|
||||
testCopy(test.copyVal, test.copyExpected, cb);
|
||||
}
|
||||
|
||||
if (testCase.loadURL) {
|
||||
loadURL(testCase.loadURL, doCheck);
|
||||
if (test.loadURL) {
|
||||
loadURL(test.loadURL, doCheck);
|
||||
} else {
|
||||
if (testCase.setURL)
|
||||
gURLBar.value = testCase.setURL;
|
||||
if (test.setURL)
|
||||
gURLBar.value = test.setURL;
|
||||
doCheck();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,12 +22,12 @@ add_task(function* () {
|
|||
|
||||
let locationChangePromise;
|
||||
let resolveLocationChangePromise;
|
||||
let expectURL = urlTemp => {
|
||||
expectedURL = urlTemp;
|
||||
let expectURL = url => {
|
||||
expectedURL = url;
|
||||
locationChangePromise = new Promise(r => resolveLocationChangePromise = r);
|
||||
};
|
||||
let wpl = {
|
||||
onLocationChange(unused, unused2, location) {
|
||||
onLocationChange(wpl, request, location, flags) {
|
||||
is(location.spec, expectedURL, "Got the expected URL");
|
||||
resolveLocationChangePromise();
|
||||
},
|
||||
|
|
|
@ -89,7 +89,7 @@ add_task(function* history() {
|
|||
|
||||
// Keys up and down through the non-history panel, i.e., the panel that's shown
|
||||
// when you type something in the textbox.
|
||||
add_task(function*() {
|
||||
add_task(function* typedValue() {
|
||||
// Use a typed value that returns the visits added above but that doesn't
|
||||
// trigger autofill since that would complicate the test.
|
||||
let typedValue = "browser_urlbarOneOffs";
|
||||
|
|
|
@ -9,7 +9,7 @@ add_task(function*() {
|
|||
let url = "http://www.example.com/foo.html";
|
||||
yield BrowserTestUtils.withNewTab({gBrowser, url}, function*(browser) {
|
||||
let wpl = {
|
||||
onLocationChange(unused, unused2, location) {
|
||||
onLocationChange(wpl, request, location, flags) {
|
||||
if (location.schemeIs("about")) {
|
||||
is(location.spec, "about:config", "Only about: location change should be for about:preferences");
|
||||
} else {
|
||||
|
|
|
@ -28,7 +28,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
|
|||
* @return promise
|
||||
*/
|
||||
function waitForDocLoadAndStopIt(aExpectedURL, aBrowser=gBrowser.selectedBrowser, aStopFromProgressListener=true) {
|
||||
function content_script(contentStopFromProgressListener) {
|
||||
function content_script(aStopFromProgressListener) {
|
||||
let { interfaces: Ci, utils: Cu } = Components;
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
let wp = docShell.QueryInterface(Ci.nsIWebProgress);
|
||||
|
@ -56,7 +56,7 @@ function waitForDocLoadAndStopIt(aExpectedURL, aBrowser=gBrowser.selectedBrowser
|
|||
let chan = req.QueryInterface(Ci.nsIChannel);
|
||||
dump(`waitForDocLoadAndStopIt: Document start: ${chan.URI.spec}\n`);
|
||||
|
||||
stopContent(contentStopFromProgressListener, chan.originalURI.spec);
|
||||
stopContent(aStopFromProgressListener, chan.originalURI.spec);
|
||||
}
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
|
||||
|
|
|
@ -534,9 +534,9 @@ function test() {
|
|||
Task.spawn(function* () {
|
||||
yield SpecialPowers.pushPrefEnv({"set": [[PREF_PERMISSION_FAKE, true]]});
|
||||
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
yield testCase.run();
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
yield test.run();
|
||||
|
||||
// Cleanup before the next test
|
||||
yield expectNoObserverCalled();
|
||||
|
|
|
@ -92,9 +92,9 @@ function test() {
|
|||
Task.spawn(function* () {
|
||||
yield SpecialPowers.pushPrefEnv({"set": [[PREF_PERMISSION_FAKE, true]]});
|
||||
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
yield testCase.run();
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
yield test.run();
|
||||
}
|
||||
}).then(finish, ex => {
|
||||
Cu.reportError(ex);
|
||||
|
|
|
@ -7,13 +7,8 @@ registerCleanupFunction(function() {
|
|||
});
|
||||
|
||||
function promiseReloadFrame(aFrameId) {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, aFrameId, function*(contentFrameId) {
|
||||
content.wrappedJSObject
|
||||
.document
|
||||
.getElementById(contentFrameId)
|
||||
.contentWindow
|
||||
.location
|
||||
.reload();
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, aFrameId, function*(aFrameId) {
|
||||
content.wrappedJSObject.document.getElementById(aFrameId).contentWindow.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -250,9 +245,9 @@ function test() {
|
|||
Task.spawn(function* () {
|
||||
yield SpecialPowers.pushPrefEnv({"set": [[PREF_PERMISSION_FAKE, true]]});
|
||||
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
yield testCase.run();
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
yield test.run();
|
||||
|
||||
// Cleanup before the next test
|
||||
yield expectNoObserverCalled();
|
||||
|
|
|
@ -89,9 +89,9 @@ function runTest() {
|
|||
Task.spawn(function* () {
|
||||
yield SpecialPowers.pushPrefEnv({"set": [[PREF_PERMISSION_FAKE, true]]});
|
||||
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
yield testCase.run();
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
yield test.run();
|
||||
|
||||
// Cleanup before the next test
|
||||
yield expectNoObserverCalled();
|
||||
|
|
|
@ -65,9 +65,9 @@ addMessageListener("Test:GetMediaCaptureState", data => {
|
|||
|
||||
addMessageListener("Test:WaitForObserverCall", ({data}) => {
|
||||
let topic = data;
|
||||
Services.obs.addObserver(function obs() {
|
||||
Services.obs.addObserver(function observer() {
|
||||
sendAsyncMessage("Test:ObserverCalled", topic);
|
||||
Services.obs.removeObserver(obs, topic);
|
||||
Services.obs.removeObserver(observer, topic);
|
||||
|
||||
if (kObservedTopics.indexOf(topic) != -1) {
|
||||
if (!(topic in gObservedTopics))
|
||||
|
|
|
@ -371,10 +371,10 @@ function* closeStream(aAlreadyClosed, aFrameId) {
|
|||
}
|
||||
|
||||
info("closing the stream");
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, aFrameId, function*(contentFrameId) {
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, aFrameId, function*(aFrameId) {
|
||||
let global = content.wrappedJSObject;
|
||||
if (contentFrameId)
|
||||
global = global.document.getElementById(contentFrameId).contentWindow;
|
||||
if (aFrameId)
|
||||
global = global.document.getElementById(aFrameId).contentWindow;
|
||||
global.closeStream();
|
||||
});
|
||||
|
||||
|
@ -413,12 +413,12 @@ function* checkSharingUI(aExpected, aWin = window) {
|
|||
identityBox.click();
|
||||
let permissions = doc.getElementById("identity-popup-permission-list");
|
||||
for (let id of ["microphone", "camera", "screen"]) {
|
||||
let convertId = idToConvert => {
|
||||
if (idToConvert == "camera")
|
||||
let convertId = id => {
|
||||
if (id == "camera")
|
||||
return "video";
|
||||
if (idToConvert == "microphone")
|
||||
if (id == "microphone")
|
||||
return "audio";
|
||||
return idToConvert;
|
||||
return id;
|
||||
};
|
||||
let expected = aExpected[convertId(id)];
|
||||
is(!!aWin.gIdentityHandler._sharingState[id], !!expected,
|
||||
|
|
|
@ -1815,7 +1815,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
}
|
||||
|
||||
let types = item.getAttribute("type").split(/\s+/);
|
||||
let type = types.find(t => t != "action" && t != "heuristic");
|
||||
let type = types.find(type => type != "action" && type != "heuristic");
|
||||
try {
|
||||
// Some types intentionally do not map to strings, which is not
|
||||
// an error.
|
||||
|
@ -2663,9 +2663,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
if (this.getAttribute("active") != "true") {
|
||||
this.setAttribute("active", "true");
|
||||
|
||||
let menuItemActiveEvent = document.createEvent("Events");
|
||||
menuItemActiveEvent.initEvent("DOMMenuItemActive", true, false);
|
||||
this.dispatchEvent(menuItemActiveEvent);
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("DOMMenuItemActive", true, false);
|
||||
this.dispatchEvent(event);
|
||||
|
||||
if (this.getAttribute("disabled") != "true") {
|
||||
let self = this;
|
||||
|
|
|
@ -80,7 +80,7 @@ add_task(function* test_cookie_getCookiesWithOriginAttributes() {
|
|||
|
||||
// Check that whether cookies has been cleared.
|
||||
for (let userContextId of Object.keys(USER_CONTEXTS)) {
|
||||
let e = getCookiesForOA(TEST_HOST, userContextId);
|
||||
ok(!e.hasMoreElements(), "No Cookie should be here");
|
||||
let enumerator = getCookiesForOA(TEST_HOST, userContextId);
|
||||
ok(!enumerator.hasMoreElements(), "No Cookie should be here");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -15,10 +15,10 @@ add_task(function* () {
|
|||
|
||||
info("Create a HTMLAnchorElement...");
|
||||
yield ContentTask.spawn(browser, URI,
|
||||
function(uri) {
|
||||
function(URI) {
|
||||
let anchor = content.document.createElement("a");
|
||||
anchor.setAttribute('id', 'clickMe');
|
||||
anchor.setAttribute("href", uri);
|
||||
anchor.setAttribute("href", URI);
|
||||
anchor.appendChild(content.document.createTextNode("click me!"));
|
||||
content.document.body.appendChild(anchor);
|
||||
}
|
||||
|
|
|
@ -1305,17 +1305,17 @@ var CustomizableUIInternal = {
|
|||
let toolboxes = gBuildWindows.get(aWindow);
|
||||
for (let toolbox of toolboxes) {
|
||||
if (toolbox.palette) {
|
||||
// Attempt to locate an element with a matching ID within
|
||||
// Attempt to locate a node with a matching ID within
|
||||
// the palette.
|
||||
let element = toolbox.palette.getElementsByAttribute("id", aId)[0];
|
||||
if (element) {
|
||||
let node = toolbox.palette.getElementsByAttribute("id", aId)[0];
|
||||
if (node) {
|
||||
// Normalize the removable attribute. For backwards compat, this
|
||||
// is optional if the widget is located in the toolbox palette,
|
||||
// and defaults to *true*, unlike if it was located elsewhere.
|
||||
if (!element.hasAttribute("removable")) {
|
||||
element.setAttribute("removable", true);
|
||||
if (!node.hasAttribute("removable")) {
|
||||
node.setAttribute("removable", true);
|
||||
}
|
||||
return element;
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,15 +205,14 @@ const CustomizableWidgets = [
|
|||
PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
|
||||
.asyncExecuteLegacyQueries([query], 1, options, {
|
||||
handleResult: function (aResultSet) {
|
||||
let onItemCommand = function (aItemCommandEvent) {
|
||||
let onItemCommand = function (aEvent) {
|
||||
// Only handle the click event for middle clicks, we're using the command
|
||||
// event otherwise.
|
||||
if (aItemCommandEvent.type == "click" &&
|
||||
aItemCommandEvent.button != 1) {
|
||||
if (aEvent.type == "click" && aEvent.button != 1) {
|
||||
return;
|
||||
}
|
||||
let item = aItemCommandEvent.target;
|
||||
win.openUILink(item.getAttribute("targetURI"), aItemCommandEvent);
|
||||
let item = aEvent.target;
|
||||
win.openUILink(item.getAttribute("targetURI"), aEvent);
|
||||
CustomizableUI.hidePanelForNode(item);
|
||||
};
|
||||
let fragment = doc.createDocumentFragment();
|
||||
|
@ -700,11 +699,11 @@ const CustomizableWidgets = [
|
|||
updateCombinedWidgetStyle(node, aArea, true);
|
||||
updateZoomResetButton();
|
||||
|
||||
let newAreaType = CustomizableUI.getAreaType(aArea);
|
||||
if (newAreaType == CustomizableUI.TYPE_MENU_PANEL) {
|
||||
let areaType = CustomizableUI.getAreaType(aArea);
|
||||
if (areaType == CustomizableUI.TYPE_MENU_PANEL) {
|
||||
let panel = aDocument.getElementById(kPanelId);
|
||||
panel.addEventListener("popupshowing", updateZoomResetButton);
|
||||
} else if (newAreaType == CustomizableUI.TYPE_TOOLBAR) {
|
||||
} else if (areaType == CustomizableUI.TYPE_TOOLBAR) {
|
||||
let container = window.gBrowser.tabContainer;
|
||||
container.addEventListener("TabSelect", updateZoomResetButton);
|
||||
}
|
||||
|
@ -714,11 +713,11 @@ const CustomizableWidgets = [
|
|||
if (aWidgetId != this.id)
|
||||
return;
|
||||
|
||||
let formerAreaType = CustomizableUI.getAreaType(aPrevArea);
|
||||
if (formerAreaType == CustomizableUI.TYPE_MENU_PANEL) {
|
||||
let areaType = CustomizableUI.getAreaType(aPrevArea);
|
||||
if (areaType == CustomizableUI.TYPE_MENU_PANEL) {
|
||||
let panel = aDocument.getElementById(kPanelId);
|
||||
panel.removeEventListener("popupshowing", updateZoomResetButton);
|
||||
} else if (formerAreaType == CustomizableUI.TYPE_TOOLBAR) {
|
||||
} else if (areaType == CustomizableUI.TYPE_TOOLBAR) {
|
||||
let container = window.gBrowser.tabContainer;
|
||||
container.removeEventListener("TabSelect", updateZoomResetButton);
|
||||
}
|
||||
|
|
|
@ -1344,10 +1344,9 @@ CustomizeMode.prototype = {
|
|||
|
||||
this._clearLWThemesMenu(aEvent.target);
|
||||
|
||||
function previewTheme(aPreviewThemeEvent) {
|
||||
LightweightThemeManager.previewTheme(
|
||||
aPreviewThemeEvent.target.theme.id != DEFAULT_THEME_ID ?
|
||||
aPreviewThemeEvent.target.theme : null);
|
||||
function previewTheme(aEvent) {
|
||||
LightweightThemeManager.previewTheme(aEvent.target.theme.id != DEFAULT_THEME_ID ?
|
||||
aEvent.target.theme : null);
|
||||
}
|
||||
|
||||
function resetPreview() {
|
||||
|
|
|
@ -54,8 +54,8 @@ add_task(function*() {
|
|||
if (singleWrapper) {
|
||||
ok(singleWrapper.node, "Widget node should exist in other window.");
|
||||
if (singleWrapper.node) {
|
||||
let expectedParentInOtherWin = CustomizableUI.getCustomizeTargetForArea(kNavBar, otherWin);
|
||||
is(singleWrapper.node.parentNode, expectedParentInOtherWin,
|
||||
let expectedParent = CustomizableUI.getCustomizeTargetForArea(kNavBar, otherWin);
|
||||
is(singleWrapper.node.parentNode, expectedParent,
|
||||
"Widget should be in navbar in other window.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ function checkSpecialContextMenus() {
|
|||
let menuItem = document.getElementById(menuID);
|
||||
let menuPopup = document.getElementById(kSpecialItemIDs[menuID]);
|
||||
info("Waiting to open menu for " + menuID);
|
||||
shownPromise = popupShown(menuPopup);
|
||||
let shownPromise = popupShown(menuPopup);
|
||||
menuPopup.openPopup(menuItem, null, 0, 0, false, false, null);
|
||||
yield shownPromise;
|
||||
|
||||
|
|
|
@ -21,13 +21,9 @@ add_task(function* testOpenCloseWindow() {
|
|||
}
|
||||
}
|
||||
CustomizableUI.addListener(openListener);
|
||||
|
||||
{
|
||||
let win = yield openAndLoadWindow(null, true);
|
||||
is(newWindow, win, "onWindowOpen event should have received expected window");
|
||||
isnot(newWindow, null, "Should have gotten onWindowOpen event");
|
||||
}
|
||||
|
||||
let win = yield openAndLoadWindow(null, true);
|
||||
isnot(newWindow, null, "Should have gotten onWindowOpen event");
|
||||
is(newWindow, win, "onWindowOpen event should have received expected window");
|
||||
CustomizableUI.removeListener(openListener);
|
||||
|
||||
let windows = [];
|
||||
|
|
|
@ -209,9 +209,9 @@ function startCustomizing(aWindow=window) {
|
|||
|
||||
function promiseObserverNotified(aTopic) {
|
||||
let deferred = Promise.defer();
|
||||
Services.obs.addObserver(function onNotification(subject, topic, data) {
|
||||
Services.obs.removeObserver(onNotification, topic);
|
||||
deferred.resolve({subject, data});
|
||||
Services.obs.addObserver(function onNotification(aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(onNotification, aTopic);
|
||||
deferred.resolve({subject: aSubject, data: aData});
|
||||
}, aTopic, false);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
|
|
@ -435,12 +435,13 @@ WebContentConverterRegistrar.prototype = {
|
|||
|
||||
callback(aNotification, aButtonInfo) {
|
||||
let protocol = aButtonInfo.protocolInfo.protocol;
|
||||
let uri = aButtonInfo.protocolInfo.uri;
|
||||
let name = aButtonInfo.protocolInfo.name;
|
||||
|
||||
let handler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
|
||||
createInstance(Ci.nsIWebHandlerApp);
|
||||
handler.name = name;
|
||||
handler.uriTemplate = aButtonInfo.protocolInfo.uri;
|
||||
handler.uriTemplate = uri;
|
||||
|
||||
let eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
|
||||
getService(Ci.nsIExternalProtocolService);
|
||||
|
|
|
@ -962,12 +962,12 @@ BrowserGlue.prototype = {
|
|||
channel.listen((id, data, target) => {
|
||||
if (data.command == "request") {
|
||||
let {Troubleshoot} = Cu.import("resource://gre/modules/Troubleshoot.jsm", {});
|
||||
Troubleshoot.snapshot(snapshotData => {
|
||||
Troubleshoot.snapshot(data => {
|
||||
// for privacy we remove crash IDs and all preferences (but bug 1091944
|
||||
// exists to expose prefs once we are confident of privacy implications)
|
||||
delete snapshotData.crashes;
|
||||
delete snapshotData.modifiedPreferences;
|
||||
channel.send(snapshotData, target);
|
||||
delete data.crashes;
|
||||
delete data.modifiedPreferences;
|
||||
channel.send(data, target);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -2369,8 +2369,8 @@ BrowserGlue.prototype = {
|
|||
body = body.replace("#2", deviceName);
|
||||
}
|
||||
|
||||
const clickCallback = (obsSubject, obsTopic, obsData) => {
|
||||
if (obsTopic == "alertclickcallback") {
|
||||
const clickCallback = (subject, topic, data) => {
|
||||
if (topic == "alertclickcallback") {
|
||||
win.gBrowser.selectedTab = firstTab;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,22 +8,22 @@ const SCRIPT_WORKER_BLOBIFY = "worker_blobify.js";
|
|||
const SCRIPT_WORKER_DEBLOBIFY = "worker_deblobify.js";
|
||||
|
||||
function page_blobify(browser, input) {
|
||||
return ContentTask.spawn(browser, input, function(contentInput) {
|
||||
return { blobURL: content.URL.createObjectURL(new content.Blob([contentInput])) };
|
||||
return ContentTask.spawn(browser, input, function(input) {
|
||||
return { blobURL: content.URL.createObjectURL(new content.Blob([input])) };
|
||||
});
|
||||
}
|
||||
|
||||
function page_deblobify(browser, blobURL) {
|
||||
return ContentTask.spawn(browser, blobURL, function* (contentBlobURL) {
|
||||
if ("error" in contentBlobURL) {
|
||||
return contentBlobURL;
|
||||
return ContentTask.spawn(browser, blobURL, function* (blobURL) {
|
||||
if ("error" in blobURL) {
|
||||
return blobURL;
|
||||
}
|
||||
contentBlobURL = contentBlobURL.blobURL;
|
||||
blobURL = blobURL.blobURL;
|
||||
|
||||
function blobURLtoBlob(aBlobURL) {
|
||||
function blobURLtoBlob(blobURL) {
|
||||
return new content.Promise(function (resolve) {
|
||||
let xhr = new content.XMLHttpRequest();
|
||||
xhr.open("GET", aBlobURL, true);
|
||||
xhr.open("GET", blobURL, true);
|
||||
xhr.onload = function () {
|
||||
resolve(xhr.response);
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ function page_deblobify(browser, blobURL) {
|
|||
});
|
||||
}
|
||||
|
||||
let blob = yield blobURLtoBlob(contentBlobURL);
|
||||
let blob = yield blobURLtoBlob(blobURL);
|
||||
if (blob == "xhr error") {
|
||||
return "xhr error";
|
||||
}
|
||||
|
|
|
@ -11,15 +11,15 @@ const re = new RegExp(key + "=([0-9\.]+)");
|
|||
|
||||
// Define the testing function
|
||||
function* doTest(aBrowser) {
|
||||
return yield ContentTask.spawn(aBrowser, [key, re],
|
||||
function ([contentKey, contentRe]) {
|
||||
let result = contentRe.exec(content.document.cookie);
|
||||
return yield ContentTask.spawn(aBrowser, {key, re},
|
||||
function ({key, re}) {
|
||||
let result = re.exec(content.document.cookie);
|
||||
if (result) {
|
||||
return result[1];
|
||||
}
|
||||
// No value is found, so we create one.
|
||||
let value = Math.random().toString();
|
||||
content.document.cookie = contentKey + "=" + value;
|
||||
content.document.cookie = key + "=" + value;
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@ const key = Math.random().toString();
|
|||
|
||||
// Define the testing function
|
||||
function* doTest(aBrowser) {
|
||||
return yield ContentTask.spawn(aBrowser, key, function (contentKey) {
|
||||
let value = content.localStorage.getItem(contentKey);
|
||||
return yield ContentTask.spawn(aBrowser, key, function (key) {
|
||||
let value = content.localStorage.getItem(key);
|
||||
if (value === null) {
|
||||
// No value is found, so we create one.
|
||||
value = Math.random().toString();
|
||||
content.localStorage.setItem(contentKey, value);
|
||||
content.localStorage.setItem(key, value);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Wait for a string to be posted to this worker.
|
||||
// Create a blob containing this string, and then
|
||||
// post back a blob URL pointing to the blob.
|
||||
self.addEventListener("message", function (message) {
|
||||
self.addEventListener("message", function (e) {
|
||||
try {
|
||||
var blobURL = URL.createObjectURL(new Blob([message.data]));
|
||||
var blobURL = URL.createObjectURL(new Blob([e.data]));
|
||||
postMessage({ blobURL });
|
||||
} catch (e) {
|
||||
postMessage({ error: e.message });
|
||||
|
|
|
@ -8,12 +8,12 @@ var postStringInBlob = function (blobObject) {
|
|||
postMessage(result);
|
||||
};
|
||||
|
||||
self.addEventListener("message", function (message) {
|
||||
if ("error" in message.data) {
|
||||
postMessage(message.data);
|
||||
self.addEventListener("message", function (e) {
|
||||
if ("error" in e.data) {
|
||||
postMessage(e.data);
|
||||
return;
|
||||
}
|
||||
var blobURL = message.data.blobURL,
|
||||
var blobURL = e.data.blobURL,
|
||||
xhr = new XMLHttpRequest();
|
||||
try {
|
||||
xhr.open("GET", blobURL, true);
|
||||
|
|
|
@ -1210,12 +1210,12 @@ this.PlacesUIUtils = {
|
|||
delete this.leftPaneQueries;
|
||||
this.leftPaneQueries = {};
|
||||
|
||||
let queryItems = as.getItemsWithAnnotation(this.ORGANIZER_QUERY_ANNO);
|
||||
let items = as.getItemsWithAnnotation(this.ORGANIZER_QUERY_ANNO);
|
||||
// While looping through queries we will also check for their validity.
|
||||
let queriesCount = 0;
|
||||
let corrupt = false;
|
||||
for (let i = 0; i < queryItems.length; i++) {
|
||||
let queryName = as.getItemAnnotation(queryItems[i], this.ORGANIZER_QUERY_ANNO);
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
let queryName = as.getItemAnnotation(items[i], this.ORGANIZER_QUERY_ANNO);
|
||||
|
||||
// Some extension did use our annotation to decorate their items
|
||||
// with icons, so we should check only our elements, to avoid dataloss.
|
||||
|
@ -1223,7 +1223,7 @@ this.PlacesUIUtils = {
|
|||
continue;
|
||||
|
||||
let query = queries[queryName];
|
||||
query.itemId = queryItems[i];
|
||||
query.itemId = items[i];
|
||||
|
||||
if (!itemExists(query.itemId)) {
|
||||
// Orphan annotation, bail out and create a new left pane root.
|
||||
|
@ -1233,7 +1233,7 @@ this.PlacesUIUtils = {
|
|||
|
||||
// Check that all queries have valid parents.
|
||||
let parentId = bs.getFolderIdForItem(query.itemId);
|
||||
if (!queryItems.includes(parentId) && parentId != leftPaneRoot) {
|
||||
if (!items.includes(parentId) && parentId != leftPaneRoot) {
|
||||
// The parent is not part of the left pane, bail out and create a new
|
||||
// left pane root.
|
||||
corrupt = true;
|
||||
|
@ -1262,7 +1262,7 @@ this.PlacesUIUtils = {
|
|||
// Queries number is wrong, so the left pane must be corrupt.
|
||||
// Note: we can't just remove the leftPaneRoot, because some query could
|
||||
// have a bad parent, so we have to remove all items one by one.
|
||||
queryItems.forEach(safeRemoveItem);
|
||||
items.forEach(safeRemoveItem);
|
||||
safeRemoveItem(leftPaneRoot);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -176,10 +176,9 @@ PlacesController.prototype = {
|
|||
case "placesCmd_open":
|
||||
case "placesCmd_open:window":
|
||||
case "placesCmd_open:privatewindow":
|
||||
case "placesCmd_open:tab": {
|
||||
let selectedNode = this._view.selectedNode;
|
||||
case "placesCmd_open:tab":
|
||||
var selectedNode = this._view.selectedNode;
|
||||
return selectedNode && PlacesUtils.nodeIsURI(selectedNode);
|
||||
}
|
||||
case "placesCmd_new:folder":
|
||||
return this._canInsert();
|
||||
case "placesCmd_new:bookmark":
|
||||
|
@ -811,7 +810,7 @@ PlacesController.prototype = {
|
|||
* The parent container to check for containment in
|
||||
* @return true if node is a member of parent's children, false otherwise.
|
||||
*/
|
||||
function isNodeContainedBy(parent) {
|
||||
function isContainedBy(node, parent) {
|
||||
var cursor = node.parent;
|
||||
while (cursor) {
|
||||
if (cursor == parent)
|
||||
|
@ -821,11 +820,11 @@ PlacesController.prototype = {
|
|||
return false;
|
||||
}
|
||||
|
||||
for (var j = 0; j < pastFolders.length; ++j) {
|
||||
if (isNodeContainedBy(pastFolders[j]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
for (var j = 0; j < pastFolders.length; ++j) {
|
||||
if (isContainedBy(node, pastFolders[j]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -726,7 +726,7 @@ var gEditItemOverlay = {
|
|||
_getFolderMenuItem(aFolderId) {
|
||||
let menupopup = this._folderMenuList.menupopup;
|
||||
let menuItem = Array.prototype.find.call(
|
||||
menupopup.childNodes, item => item.folderId === aFolderId);
|
||||
menupopup.childNodes, menuItem => menuItem.folderId === aFolderId);
|
||||
if (menuItem !== undefined)
|
||||
return menuItem;
|
||||
|
||||
|
|
|
@ -322,6 +322,7 @@
|
|||
}
|
||||
|
||||
if (window.XULBrowserWindow) {
|
||||
let elt = event.target;
|
||||
let placesNode = elt._placesNode;
|
||||
|
||||
var linkURI;
|
||||
|
|
|
@ -798,11 +798,11 @@ var PlacesSearchBox = {
|
|||
case "bookmarks":
|
||||
currentView.applyFilter(filterString, this.folders);
|
||||
break;
|
||||
case "history": {
|
||||
case "history":
|
||||
if (currentOptions.queryType != Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY) {
|
||||
let query = PlacesUtils.history.getNewQuery();
|
||||
var query = PlacesUtils.history.getNewQuery();
|
||||
query.searchTerms = filterString;
|
||||
let options = currentOptions.clone();
|
||||
var options = currentOptions.clone();
|
||||
// Make sure we're getting uri results.
|
||||
options.resultType = currentOptions.RESULTS_AS_URI;
|
||||
options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY;
|
||||
|
@ -815,8 +815,7 @@ var PlacesSearchBox = {
|
|||
TelemetryStopwatch.finish(HISTORY_LIBRARY_SEARCH_TELEMETRY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "downloads": {
|
||||
case "downloads":
|
||||
if (currentView == ContentTree.view) {
|
||||
let query = PlacesUtils.history.getNewQuery();
|
||||
query.searchTerms = filterString;
|
||||
|
@ -833,7 +832,6 @@ var PlacesSearchBox = {
|
|||
currentView.searchTerm = filterString;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw "Invalid filterCollection on search";
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
if (this.hasSelection && this.selectedNode.uri == placeURI)
|
||||
return;
|
||||
|
||||
function findNode(container, nodesURIChecked) {
|
||||
function findNode(container, placeURI, nodesURIChecked) {
|
||||
var containerURI = container.uri;
|
||||
if (containerURI == placeURI)
|
||||
return container;
|
||||
|
@ -187,7 +187,7 @@
|
|||
if (childURI == placeURI)
|
||||
return child;
|
||||
else if (PlacesUtils.nodeIsContainer(child)) {
|
||||
var nested = findNode(PlacesUtils.asContainer(child), nodesURIChecked);
|
||||
var nested = findNode(PlacesUtils.asContainer(child), placeURI, nodesURIChecked);
|
||||
if (nested)
|
||||
return nested;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@
|
|||
if (!container)
|
||||
return;
|
||||
|
||||
var child = findNode(container, []);
|
||||
var child = findNode(container, placeURI, []);
|
||||
if (child)
|
||||
this.selectNode(child);
|
||||
else {
|
||||
|
|
|
@ -713,7 +713,7 @@ PlacesTreeView.prototype = {
|
|||
|
||||
// Redraw the parent if its twisty state has changed.
|
||||
if (aParentNode != this._rootNode && !aParentNode.hasChildren) {
|
||||
parentRow = oldRow - 1;
|
||||
let parentRow = oldRow - 1;
|
||||
this._tree.invalidateRow(parentRow);
|
||||
}
|
||||
|
||||
|
@ -1184,8 +1184,8 @@ PlacesTreeView.prototype = {
|
|||
PlacesUtils.livemarks.getLivemark({ id: node.itemId })
|
||||
.then(aLivemark => {
|
||||
this._controller.cacheLivemarkInfo(node, aLivemark);
|
||||
let livemarkProps = this._cellProperties.get(node);
|
||||
this._cellProperties.set(node, livemarkProps += " livemark");
|
||||
let props = this._cellProperties.get(node);
|
||||
this._cellProperties.set(node, props += " livemark");
|
||||
// The livemark attribute is set as a cell property on the title cell.
|
||||
this._invalidateCellValue(node, this.COLUMN_TYPE_TITLE);
|
||||
}, () => undefined);
|
||||
|
|
|
@ -23,7 +23,7 @@ add_task(function* () {
|
|||
yield PlacesTestUtils.addVisits(visits);
|
||||
|
||||
// create an initial tag to work with
|
||||
let newBookmark = yield PlacesUtils.bookmarks.insert({
|
||||
let bm = yield PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
index: PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
|
||||
|
@ -31,7 +31,7 @@ add_task(function* () {
|
|||
url: TEST_URL
|
||||
});
|
||||
|
||||
ok(newBookmark, "A bookmark was added");
|
||||
ok(bm, "A bookmark was added");
|
||||
PlacesUtils.tagging.tagURI(TEST_URL, ["foo"]);
|
||||
let tags = PlacesUtils.tagging.getTagsForURI(TEST_URL);
|
||||
is(tags[0], "foo", "tag is foo");
|
||||
|
|
|
@ -15,7 +15,7 @@ add_task(function* () {
|
|||
},
|
||||
function* test(dialogWin) {
|
||||
let promiseTitleChangeNotification = promiseBookmarksNotification(
|
||||
"onItemChanged", (unused, prop, isAnno, val) => prop == "title" && val == "modified");
|
||||
"onItemChanged", (itemId, prop, isAnno, val) => prop == "title" && val == "modified");
|
||||
|
||||
fillBookmarkTextField("editBMPanel_namePicker", "modified", dialogWin);
|
||||
|
||||
|
|
|
@ -404,20 +404,20 @@ function open_properties_dialog() {
|
|||
if (aTopic != "domwindowopened")
|
||||
return;
|
||||
ww.unregisterNotification(windowObserver);
|
||||
let observerWindow = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
waitForFocus(() => {
|
||||
// Windows has been loaded, execute our test now.
|
||||
executeSoon(function () {
|
||||
// Ensure overlay is loaded
|
||||
ok(observerWindow.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
|
||||
gCurrentTest.window = observerWindow;
|
||||
ok(win.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
|
||||
gCurrentTest.window = win;
|
||||
try {
|
||||
gCurrentTest.run();
|
||||
} catch (ex) {
|
||||
ok(false, "An error occured during test run: " + ex.message);
|
||||
}
|
||||
});
|
||||
}, observerWindow);
|
||||
}, win);
|
||||
}
|
||||
ww.registerNotification(windowObserver);
|
||||
|
||||
|
|
|
@ -226,10 +226,10 @@ var gTests = [
|
|||
|
||||
function nextTest() {
|
||||
if (gTests.length) {
|
||||
var testCase = gTests.shift();
|
||||
var test = gTests.shift();
|
||||
waitForFocus(function() {
|
||||
info("Start of test: " + testCase.desc);
|
||||
testCase.run();
|
||||
info("Start of test: " + test.desc);
|
||||
test.run();
|
||||
});
|
||||
}
|
||||
else if (wasCollapsed) {
|
||||
|
|
|
@ -102,9 +102,9 @@ function test() {
|
|||
|
||||
function nextTest() {
|
||||
if (gTests.length) {
|
||||
var testCase = gTests.shift();
|
||||
info("Start of test: " + testCase.desc);
|
||||
testCase.run();
|
||||
var test = gTests.shift();
|
||||
info("Start of test: " + test.desc);
|
||||
test.run();
|
||||
}
|
||||
else {
|
||||
// Close Library window.
|
||||
|
|
|
@ -169,10 +169,10 @@ function getAndCheckElmtById(id) {
|
|||
|
||||
function nextTest() {
|
||||
if (gTests.length) {
|
||||
var testCase = gTests.shift();
|
||||
ok(true, "TEST: " + testCase.desc);
|
||||
dump("TEST: " + testCase.desc + "\n");
|
||||
testCase.run();
|
||||
var test = gTests.shift();
|
||||
ok(true, "TEST: " + test.desc);
|
||||
dump("TEST: " + test.desc + "\n");
|
||||
test.run();
|
||||
}
|
||||
else {
|
||||
// Close Library window.
|
||||
|
|
|
@ -187,10 +187,10 @@ function testSortByColAndDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
|
|||
ok(colId in SORT_LOOKUP_TABLE,
|
||||
"sanity check: unexpected placeContent column anonid");
|
||||
|
||||
let sortStr =
|
||||
let sortConst =
|
||||
"SORT_BY_" + SORT_LOOKUP_TABLE[colId].key + "_" +
|
||||
(aUnsortFirst ? SORT_LOOKUP_TABLE[colId].dir : prevSortDir);
|
||||
let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortStr];
|
||||
let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortConst];
|
||||
let expectedAnno = SORT_LOOKUP_TABLE[colId].anno || "";
|
||||
|
||||
// Test sorting by only a column.
|
||||
|
@ -199,9 +199,9 @@ function testSortByColAndDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
|
|||
|
||||
// Test sorting by both a column and a direction.
|
||||
["ascending", "descending"].forEach(function (dir) {
|
||||
sortStr =
|
||||
let sortConst =
|
||||
"SORT_BY_" + SORT_LOOKUP_TABLE[colId].key + "_" + dir.toUpperCase();
|
||||
expectedSortMode = Ci.nsINavHistoryQueryOptions[sortStr];
|
||||
let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortConst];
|
||||
setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst, false, col, dir);
|
||||
checkSort(aPlaceContentTree, expectedSortMode, expectedAnno);
|
||||
});
|
||||
|
@ -221,8 +221,8 @@ function testSortByColAndDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
|
|||
function testSortByDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
|
||||
["ascending", "descending"].forEach(function (dir) {
|
||||
let key = (aUnsortFirst ? DEFAULT_SORT_KEY : prevSortKey);
|
||||
let sortStr = "SORT_BY_" + key + "_" + dir.toUpperCase();
|
||||
let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortStr];
|
||||
let sortConst = "SORT_BY_" + key + "_" + dir.toUpperCase();
|
||||
let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortConst];
|
||||
setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst, false, null, dir);
|
||||
checkSort(aPlaceContentTree, expectedSortMode, "");
|
||||
});
|
||||
|
|
|
@ -312,7 +312,7 @@ function searchItemInView(aItemId, aView, aValidator) {
|
|||
* @returns [node, index] or [null, null] if not found.
|
||||
*/
|
||||
function getNodeForToolbarItem(aItemId, aValidator) {
|
||||
var placesToolbarItems = document.getElementById("PlacesToolbarItems");
|
||||
var toolbar = document.getElementById("PlacesToolbarItems");
|
||||
|
||||
function findNode(aContainer) {
|
||||
var children = aContainer.childNodes;
|
||||
|
@ -344,7 +344,7 @@ function getNodeForToolbarItem(aItemId, aValidator) {
|
|||
return [null, null];
|
||||
}
|
||||
|
||||
return findNode(placesToolbarItems);
|
||||
return findNode(toolbar);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,8 +14,8 @@ if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function") {
|
|||
|
||||
// ...And restore it when test ends.
|
||||
registerCleanupFunction(function() {
|
||||
let updatedGetter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (cachedLeftPaneFolderIdGetter && typeof(updatedGetter) != "function") {
|
||||
let getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (cachedLeftPaneFolderIdGetter && typeof(getter) != "function") {
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
}
|
||||
});
|
||||
|
@ -150,7 +150,7 @@ function synthesizeClickOnSelectedTreeCell(aTree, aOptions) {
|
|||
function promiseIsURIVisited(aURI) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
|
||||
PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
|
||||
deferred.resolve(aIsVisited);
|
||||
});
|
||||
|
||||
|
|
|
@ -1411,8 +1411,8 @@ var gApplicationsPane = {
|
|||
|
||||
// Add a separator to distinguish these items from the helper app items
|
||||
// that follow them.
|
||||
let menuseparator = document.createElement("menuseparator");
|
||||
menuPopup.appendChild(menuseparator);
|
||||
let menuItem = document.createElement("menuseparator");
|
||||
menuPopup.appendChild(menuItem);
|
||||
|
||||
// Create a menu item for the OS default application, if any.
|
||||
if (handlerInfo.hasDefaultHandler) {
|
||||
|
@ -1760,8 +1760,8 @@ var gApplicationsPane = {
|
|||
handlerApp.executable = fp.file;
|
||||
|
||||
// Add the app to the type's list of possible handlers.
|
||||
let handler = this._handledTypes[this._list.selectedItem.type];
|
||||
handler.addPossibleApplicationHandler(handlerApp);
|
||||
let handlerInfo = this._handledTypes[this._list.selectedItem.type];
|
||||
handlerInfo.addPossibleApplicationHandler(handlerApp);
|
||||
|
||||
chooseAppCallback(handlerApp);
|
||||
}
|
||||
|
|
|
@ -152,8 +152,8 @@ var gSyncPane = {
|
|||
document.getElementById("tosPP-small-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
|
||||
document.getElementById("tosPP-normal-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
|
||||
|
||||
fxAccounts.promiseAccountsManageURI(this._getEntryPoint()).then(accountsManageURI => {
|
||||
document.getElementById("verifiedManage").setAttribute("href", accountsManageURI);
|
||||
fxAccounts.promiseAccountsManageURI(this._getEntryPoint()).then(url => {
|
||||
document.getElementById("verifiedManage").setAttribute("href", url);
|
||||
});
|
||||
|
||||
this.updateWeavePrefs();
|
||||
|
|
|
@ -292,10 +292,10 @@ var testRunner = {
|
|||
|
||||
os.removeObserver(permObserver, "perm-changed");
|
||||
|
||||
let testCase = testRunner.tests[testRunner._currentTest];
|
||||
if (!testCase.expectPermObservancesDuringTestFunction) {
|
||||
if (testCase.cleanUp) {
|
||||
testCase.cleanUp(params);
|
||||
let test = testRunner.tests[testRunner._currentTest];
|
||||
if (!test.expectPermObservancesDuringTestFunction) {
|
||||
if (test.cleanUp) {
|
||||
test.cleanUp(params);
|
||||
}
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
@ -314,11 +314,11 @@ var testRunner = {
|
|||
}
|
||||
|
||||
try {
|
||||
let testCase = testRunner.tests[testRunner._currentTest];
|
||||
testCase.test(params);
|
||||
if (testCase.expectPermObservancesDuringTestFunction) {
|
||||
if (testCase.cleanUp) {
|
||||
testCase.cleanUp(params);
|
||||
let test = testRunner.tests[testRunner._currentTest];
|
||||
test.test(params);
|
||||
if (test.expectPermObservancesDuringTestFunction) {
|
||||
if (test.cleanUp) {
|
||||
test.cleanUp(params);
|
||||
}
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
|
|
@ -77,7 +77,7 @@ registerCleanupFunction(function() {
|
|||
});
|
||||
|
||||
function* test_with_mock_shellservice(options, testFn) {
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, options, function*(contentOptions) {
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, options, function*(options) {
|
||||
let doc = content.document;
|
||||
let win = doc.defaultView;
|
||||
win.oldShellService = win.getShellService();
|
||||
|
@ -93,7 +93,7 @@ function* test_with_mock_shellservice(options, testFn) {
|
|||
win.getShellService = function() {
|
||||
return mockShellService;
|
||||
}
|
||||
mockShellService._isDefault = contentOptions.isDefault;
|
||||
mockShellService._isDefault = options.isDefault;
|
||||
win.gMainPane.updateSetDefaultBrowser();
|
||||
});
|
||||
|
||||
|
|
|
@ -15,16 +15,17 @@ function* open_subdialog_and_test_generic_start_state(browser, domcontentloadedF
|
|||
"(" + domcontentloadedFn.toString() + ")()" :
|
||||
"";
|
||||
return ContentTask.spawn(browser, {url, domcontentloadedFnStr}, function*(args) {
|
||||
let {url, domcontentloadedFnStr} = args;
|
||||
let rv = { acceptCount: 0 };
|
||||
let win = content.window;
|
||||
let subdialog = win.gSubDialog;
|
||||
subdialog.open(args.url, null, rv);
|
||||
subdialog.open(url, null, rv);
|
||||
|
||||
info("waiting for subdialog DOMFrameContentLoaded");
|
||||
yield ContentTaskUtils.waitForEvent(win, "DOMFrameContentLoaded", true);
|
||||
let result;
|
||||
if (args.domcontentloadedFnStr) {
|
||||
result = eval(args.domcontentloadedFnStr);
|
||||
if (domcontentloadedFnStr) {
|
||||
result = eval(domcontentloadedFnStr);
|
||||
}
|
||||
|
||||
info("waiting for subdialog load");
|
||||
|
@ -58,7 +59,7 @@ function* close_subdialog_and_test_generic_end_state(browser, closingFn, closing
|
|||
info("waiting for dialogclosing");
|
||||
let closingEvent =
|
||||
yield ContentTaskUtils.waitForEvent(frame.contentWindow, "dialogclosing");
|
||||
let contentClosingButton = closingEvent.detail.button;
|
||||
let closingButton = closingEvent.detail.button;
|
||||
let actualAcceptCount = frame.contentWindow.arguments &&
|
||||
frame.contentWindow.arguments[0].acceptCount;
|
||||
|
||||
|
@ -70,7 +71,7 @@ function* close_subdialog_and_test_generic_end_state(browser, closingFn, closing
|
|||
Assert.equal(frame.getAttribute("style"), "", "inline styles should be cleared");
|
||||
Assert.equal(frame.contentWindow.location.href.toString(), "about:blank",
|
||||
"sub-dialog should be unloaded");
|
||||
Assert.equal(contentClosingButton, expectations.closingButton,
|
||||
Assert.equal(closingButton, expectations.closingButton,
|
||||
"closing event should indicate button was '" + expectations.closingButton + "'");
|
||||
Assert.equal(actualAcceptCount, expectations.acceptCount,
|
||||
"should be 1 if accepted, 0 if canceled, undefined if closed w/out button");
|
||||
|
@ -216,7 +217,7 @@ add_task(function* wrapped_text_in_dialog_should_have_expected_scrollHeight() {
|
|||
let oldHeight = yield open_subdialog_and_test_generic_start_state(tab.linkedBrowser, function domcontentloadedFn() {
|
||||
let frame = content.window.gSubDialog._frame;
|
||||
let doc = frame.contentDocument;
|
||||
let scrollHeight = doc.documentElement.scrollHeight;
|
||||
let oldHeight = doc.documentElement.scrollHeight;
|
||||
doc.documentElement.style.removeProperty("height");
|
||||
doc.getElementById("desc").textContent = `
|
||||
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque
|
||||
|
@ -230,16 +231,16 @@ add_task(function* wrapped_text_in_dialog_should_have_expected_scrollHeight() {
|
|||
architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas
|
||||
sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione
|
||||
voluptatem sequi nesciunt.`
|
||||
return scrollHeight;
|
||||
return oldHeight;
|
||||
});
|
||||
|
||||
yield ContentTask.spawn(tab.linkedBrowser, oldHeight, function*(contentOldHeight) {
|
||||
yield ContentTask.spawn(tab.linkedBrowser, oldHeight, function*(oldHeight) {
|
||||
let frame = content.window.gSubDialog._frame;
|
||||
let docEl = frame.contentDocument.documentElement;
|
||||
Assert.equal(frame.style.width, "32em",
|
||||
"Width should be set on the frame from the dialog");
|
||||
Assert.ok(docEl.scrollHeight > contentOldHeight,
|
||||
"Content height increased (from " + contentOldHeight + " to " + docEl.scrollHeight + ").");
|
||||
Assert.ok(docEl.scrollHeight > oldHeight,
|
||||
"Content height increased (from " + oldHeight + " to " + docEl.scrollHeight + ").");
|
||||
Assert.equal(frame.style.height, docEl.scrollHeight + "px",
|
||||
"Height on the frame should be higher now");
|
||||
});
|
||||
|
|
|
@ -133,8 +133,8 @@ function test()
|
|||
Services.telemetry.canRecordExtended = true;
|
||||
checkTelemetryRecords();
|
||||
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
|
||||
// Create a tab to run the test.
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
|
@ -145,7 +145,7 @@ function test()
|
|||
yield promiseTabLoadEvent(tab, url);
|
||||
|
||||
info("Running test");
|
||||
yield testCase.run();
|
||||
yield test.run();
|
||||
|
||||
info("Cleanup");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
|
|
@ -85,9 +85,9 @@ function test() {
|
|||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:newtab");
|
||||
info("Waiting for about:newtab load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(loadEvent) {
|
||||
if (loadEvent.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
loadEvent.target.location.href == "about:blank") {
|
||||
tab.linkedBrowser.addEventListener("load", function load(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
|
@ -101,9 +101,9 @@ function test() {
|
|||
}
|
||||
else {
|
||||
info("Waiting for newtab search init");
|
||||
win.addEventListener("ContentSearchService", function done(contentSearchServiceEvent) {
|
||||
info("Got newtab search event " + contentSearchServiceEvent.detail.type);
|
||||
if (contentSearchServiceEvent.detail.type == "State") {
|
||||
win.addEventListener("ContentSearchService", function done(event) {
|
||||
info("Got newtab search event " + event.detail.type);
|
||||
if (event.detail.type == "State") {
|
||||
win.removeEventListener("ContentSearchService", done);
|
||||
// Let gSearch respond to the event before continuing.
|
||||
executeSoon(() => doSearch(win.document));
|
||||
|
|
|
@ -85,9 +85,9 @@ function test() {
|
|||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:newtab");
|
||||
info("Waiting for about:newtab load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(loadEvent) {
|
||||
if (loadEvent.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
loadEvent.target.location.href == "about:blank") {
|
||||
tab.linkedBrowser.addEventListener("load", function load(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
|
@ -101,9 +101,9 @@ function test() {
|
|||
}
|
||||
else {
|
||||
info("Waiting for newtab search init");
|
||||
win.addEventListener("ContentSearchService", function done(contentSearchServiceEvent) {
|
||||
info("Got newtab search event " + contentSearchServiceEvent.detail.type);
|
||||
if (contentSearchServiceEvent.detail.type == "State") {
|
||||
win.addEventListener("ContentSearchService", function done(event) {
|
||||
info("Got newtab search event " + event.detail.type);
|
||||
if (event.detail.type == "State") {
|
||||
win.removeEventListener("ContentSearchService", done);
|
||||
// Let gSearch respond to the event before continuing.
|
||||
executeSoon(() => doSearch(win.document));
|
||||
|
|
|
@ -83,9 +83,9 @@ function test() {
|
|||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:newtab");
|
||||
info("Waiting for about:newtab load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(loadEvent) {
|
||||
if (loadEvent.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
loadEvent.target.location.href == "about:blank") {
|
||||
tab.linkedBrowser.addEventListener("load", function load(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
|
@ -99,9 +99,9 @@ function test() {
|
|||
}
|
||||
else {
|
||||
info("Waiting for newtab search init");
|
||||
win.addEventListener("ContentSearchService", function done(searchServiceEvent) {
|
||||
info("Got newtab search event " + searchServiceEvent.detail.type);
|
||||
if (searchServiceEvent.detail.type == "State") {
|
||||
win.addEventListener("ContentSearchService", function done(event) {
|
||||
info("Got newtab search event " + event.detail.type);
|
||||
if (event.detail.type == "State") {
|
||||
win.removeEventListener("ContentSearchService", done);
|
||||
// Let gSearch respond to the event before continuing.
|
||||
executeSoon(() => doSearch(win.document));
|
||||
|
|
|
@ -41,8 +41,8 @@ function test() {
|
|||
Assert.equal(hs[histogramKey].sum, numSearchesBefore + 1,
|
||||
"Performing a search increments the related SEARCH_COUNTS key by 1.");
|
||||
|
||||
let fooEngine = Services.search.getEngineByName("Foo");
|
||||
Services.search.removeEngine(fooEngine);
|
||||
let engine = Services.search.getEngineByName("Foo");
|
||||
Services.search.removeEngine(engine);
|
||||
}
|
||||
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
|
|
|
@ -35,20 +35,20 @@ add_task(function* init() {
|
|||
|
||||
yield new Promise((resolve, reject) => {
|
||||
info("adding search history values: " + kValues);
|
||||
let addOps = kValues.map(value => { return {op: "add",
|
||||
let ops = kValues.map(value => { return {op: "add",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(addOps, {
|
||||
searchbar.FormHistory.update(ops, {
|
||||
handleCompletion: function() {
|
||||
registerCleanupFunction(() => {
|
||||
info("removing search history values: " + kValues);
|
||||
let removeOps =
|
||||
let ops =
|
||||
kValues.map(value => { return {op: "remove",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(removeOps);
|
||||
searchbar.FormHistory.update(ops);
|
||||
});
|
||||
resolve();
|
||||
},
|
||||
|
|
|
@ -56,20 +56,20 @@ add_task(function* init() {
|
|||
|
||||
yield new Promise((resolve, reject) => {
|
||||
info("adding search history values: " + kValues);
|
||||
let addOps = kValues.map(value => { return {op: "add",
|
||||
let ops = kValues.map(value => { return {op: "add",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(addOps, {
|
||||
searchbar.FormHistory.update(ops, {
|
||||
handleCompletion: function() {
|
||||
registerCleanupFunction(() => {
|
||||
info("removing search history values: " + kValues);
|
||||
let removeOps =
|
||||
let ops =
|
||||
kValues.map(value => { return {op: "remove",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(removeOps);
|
||||
searchbar.FormHistory.update(ops);
|
||||
});
|
||||
resolve();
|
||||
},
|
||||
|
|
|
@ -36,20 +36,20 @@ add_task(function* init() {
|
|||
|
||||
yield new Promise((resolve, reject) => {
|
||||
info("adding search history values: " + kValues);
|
||||
let addOps = kValues.map(value => { return {op: "add",
|
||||
let ops = kValues.map(value => { return {op: "add",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(addOps, {
|
||||
searchbar.FormHistory.update(ops, {
|
||||
handleCompletion: function() {
|
||||
registerCleanupFunction(() => {
|
||||
info("removing search history values: " + kValues);
|
||||
let removeOps =
|
||||
let ops =
|
||||
kValues.map(value => { return {op: "remove",
|
||||
fieldname: "searchbar-history",
|
||||
value: value}
|
||||
});
|
||||
searchbar.FormHistory.update(removeOps);
|
||||
searchbar.FormHistory.update(ops);
|
||||
});
|
||||
resolve();
|
||||
},
|
||||
|
|
|
@ -85,9 +85,9 @@ function test() {
|
|||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:newtab");
|
||||
info("Waiting for about:newtab load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(loadEvent) {
|
||||
if (loadEvent.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
loadEvent.target.location.href == "about:blank") {
|
||||
tab.linkedBrowser.addEventListener("load", function load(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
|
@ -101,9 +101,9 @@ function test() {
|
|||
}
|
||||
else {
|
||||
info("Waiting for newtab search init");
|
||||
win.addEventListener("ContentSearchService", function done(searchServiceEvent) {
|
||||
info("Got newtab search event " + searchServiceEvent.detail.type);
|
||||
if (searchServiceEvent.detail.type == "State") {
|
||||
win.addEventListener("ContentSearchService", function done(event) {
|
||||
info("Got newtab search event " + event.detail.type);
|
||||
if (event.detail.type == "State") {
|
||||
win.removeEventListener("ContentSearchService", done);
|
||||
// Let gSearch respond to the event before continuing.
|
||||
executeSoon(() => doSearch(win.document));
|
||||
|
|
|
@ -215,13 +215,13 @@ function testDefaultArgs()
|
|||
reloadUpdateManagerData();
|
||||
|
||||
for (let i = 0; i < BCH_TESTS.length; i++) {
|
||||
let testCase = BCH_TESTS[i];
|
||||
ok(true, "Test nsBrowserContentHandler " + (i + 1) + ": " + testCase.description);
|
||||
let test = BCH_TESTS[i];
|
||||
ok(true, "Test nsBrowserContentHandler " + (i + 1) + ": " + test.description);
|
||||
|
||||
if (testCase.actions) {
|
||||
let actionsXML = " actions=\"" + testCase.actions + "\"";
|
||||
if (testCase.openURL) {
|
||||
actionsXML += " openURL=\"" + testCase.openURL + "\"";
|
||||
if (test.actions) {
|
||||
let actionsXML = " actions=\"" + test.actions + "\"";
|
||||
if (test.openURL) {
|
||||
actionsXML += " openURL=\"" + test.openURL + "\"";
|
||||
}
|
||||
writeUpdatesToXMLFile(XML_PREFIX + actionsXML + XML_SUFFIX);
|
||||
} else {
|
||||
|
@ -234,10 +234,10 @@ function testDefaultArgs()
|
|||
getService(Ci.nsIBrowserHandler).defaultArgs;
|
||||
|
||||
let overrideArgs = "";
|
||||
if (testCase.prefURL) {
|
||||
overrideArgs = testCase.prefURL;
|
||||
} else if (testCase.openURL) {
|
||||
overrideArgs = testCase.openURL;
|
||||
if (test.prefURL) {
|
||||
overrideArgs = test.prefURL;
|
||||
} else if (test.openURL) {
|
||||
overrideArgs = test.openURL;
|
||||
}
|
||||
|
||||
if (overrideArgs == "" && noOverrideArgs) {
|
||||
|
@ -246,11 +246,11 @@ function testDefaultArgs()
|
|||
overrideArgs += "|" + noOverrideArgs;
|
||||
}
|
||||
|
||||
if (testCase.noMstoneChange === undefined) {
|
||||
if (test.noMstoneChange === undefined) {
|
||||
gPrefService.setCharPref(PREF_MSTONE, "PreviousMilestone");
|
||||
}
|
||||
|
||||
if (testCase.noPostUpdatePref == undefined) {
|
||||
if (test.noPostUpdatePref == undefined) {
|
||||
gPrefService.setBoolPref(PREF_POSTUPDATE, true);
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ function testDefaultArgs()
|
|||
getService(Ci.nsIBrowserHandler).defaultArgs;
|
||||
is(defaultArgs, overrideArgs, "correct value returned by defaultArgs");
|
||||
|
||||
if (testCase.noMstoneChange === undefined || testCase.noMstoneChange != true) {
|
||||
if (test.noMstoneChange === undefined || test.noMstoneChange != true) {
|
||||
let newMstone = gPrefService.getCharPref(PREF_MSTONE);
|
||||
is(originalMstone, newMstone, "preference " + PREF_MSTONE +
|
||||
" should have been updated");
|
||||
|
@ -309,22 +309,22 @@ function testShowNotification()
|
|||
gWindowCatcher.start();
|
||||
|
||||
for (let i = 0; i < BG_NOTIFY_TESTS.length; i++) {
|
||||
let testCase = BG_NOTIFY_TESTS[i];
|
||||
ok(true, "Test showNotification " + (i + 1) + ": " + testCase.description);
|
||||
let test = BG_NOTIFY_TESTS[i];
|
||||
ok(true, "Test showNotification " + (i + 1) + ": " + test.description);
|
||||
|
||||
if (testCase.actions) {
|
||||
let actionsXML = " actions=\"" + testCase.actions + "\"";
|
||||
if (testCase.notificationText) {
|
||||
actionsXML += " notificationText=\"" + testCase.notificationText + "\"";
|
||||
if (test.actions) {
|
||||
let actionsXML = " actions=\"" + test.actions + "\"";
|
||||
if (test.notificationText) {
|
||||
actionsXML += " notificationText=\"" + test.notificationText + "\"";
|
||||
}
|
||||
if (testCase.notificationURL) {
|
||||
actionsXML += " notificationURL=\"" + testCase.notificationURL + "\"";
|
||||
if (test.notificationURL) {
|
||||
actionsXML += " notificationURL=\"" + test.notificationURL + "\"";
|
||||
}
|
||||
if (testCase.notificationButtonLabel) {
|
||||
actionsXML += " notificationButtonLabel=\"" + testCase.notificationButtonLabel + "\"";
|
||||
if (test.notificationButtonLabel) {
|
||||
actionsXML += " notificationButtonLabel=\"" + test.notificationButtonLabel + "\"";
|
||||
}
|
||||
if (testCase.notificationButtonAccessKey) {
|
||||
actionsXML += " notificationButtonAccessKey=\"" + testCase.notificationButtonAccessKey + "\"";
|
||||
if (test.notificationButtonAccessKey) {
|
||||
actionsXML += " notificationButtonAccessKey=\"" + test.notificationButtonAccessKey + "\"";
|
||||
}
|
||||
writeUpdatesToXMLFile(XML_PREFIX + actionsXML + XML_SUFFIX);
|
||||
} else {
|
||||
|
@ -337,21 +337,21 @@ function testShowNotification()
|
|||
gBG.observe(null, "browser-glue-test", "post-update-notification");
|
||||
|
||||
let updateBox = notifyBox.getNotificationWithValue("post-update-notification");
|
||||
if (testCase.actions && testCase.actions.indexOf("showNotification") != -1 &&
|
||||
testCase.actions.indexOf("silent") == -1) {
|
||||
if (test.actions && test.actions.indexOf("showNotification") != -1 &&
|
||||
test.actions.indexOf("silent") == -1) {
|
||||
ok(updateBox, "Update notification box should have been displayed");
|
||||
if (updateBox) {
|
||||
if (testCase.notificationText) {
|
||||
is(updateBox.label, testCase.notificationText, "Update notification box " +
|
||||
if (test.notificationText) {
|
||||
is(updateBox.label, test.notificationText, "Update notification box " +
|
||||
"should have the label provided by the update");
|
||||
}
|
||||
if (testCase.notificationButtonLabel) {
|
||||
if (test.notificationButtonLabel) {
|
||||
var button = updateBox.getElementsByTagName("button").item(0);
|
||||
is(button.label, testCase.notificationButtonLabel, "Update notification " +
|
||||
is(button.label, test.notificationButtonLabel, "Update notification " +
|
||||
"box button should have the label provided by the update");
|
||||
if (testCase.notificationButtonAccessKey) {
|
||||
if (test.notificationButtonAccessKey) {
|
||||
let accessKey = button.getAttribute("accesskey");
|
||||
is(accessKey, testCase.notificationButtonAccessKey, "Update " +
|
||||
is(accessKey, test.notificationButtonAccessKey, "Update " +
|
||||
"notification box button should have the accesskey " +
|
||||
"provided by the update");
|
||||
}
|
||||
|
|
|
@ -188,9 +188,9 @@ TranslationUI.prototype = {
|
|||
|
||||
if (aTopic != "showing")
|
||||
return false;
|
||||
let translationNotification = this.notificationBox.getNotificationWithValue("translation");
|
||||
if (translationNotification)
|
||||
translationNotification.close();
|
||||
let notification = this.notificationBox.getNotificationWithValue("translation");
|
||||
if (notification)
|
||||
notification.close();
|
||||
else
|
||||
this.showTranslationInfoBar();
|
||||
return true;
|
||||
|
|
|
@ -25,9 +25,9 @@ function test() {
|
|||
tab.linkedBrowser.addEventListener("load", function onload() {
|
||||
tab.linkedBrowser.removeEventListener("load", onload, true);
|
||||
Task.spawn(function* () {
|
||||
for (let testCase of gTests) {
|
||||
info(testCase.desc);
|
||||
yield testCase.run();
|
||||
for (let test of gTests) {
|
||||
info(test.desc);
|
||||
yield test.run();
|
||||
}
|
||||
}).then(finish, ex => {
|
||||
ok(false, "Unexpected Exception: " + ex);
|
||||
|
|
|
@ -243,14 +243,17 @@ var tests = [
|
|||
is(icon.src, "", "Popup should have no icon");
|
||||
is(buttons.hasChildNodes(), false, "Popup should have no buttons");
|
||||
|
||||
popup.addEventListener("popuphidden", function() {
|
||||
popup.addEventListener("popupshown", function() {
|
||||
popup.addEventListener("popuphidden", function onPopupHidden() {
|
||||
popup.removeEventListener("popuphidden", onPopupHidden);
|
||||
|
||||
popup.addEventListener("popupshown", function onPopupShown() {
|
||||
popup.removeEventListener("popupshown", onPopupShown);
|
||||
done();
|
||||
}, {once: true});
|
||||
});
|
||||
|
||||
gContentAPI.showInfo("urlbar", "test title", "test text");
|
||||
|
||||
}, {once: true});
|
||||
});
|
||||
gContentAPI.hideInfo();
|
||||
});
|
||||
|
||||
|
@ -297,9 +300,9 @@ var tests = [
|
|||
let defaults = Services.prefs.getDefaultBranch("distribution.");
|
||||
let testDistributionID = "TestDistribution";
|
||||
defaults.setCharPref("id", testDistributionID);
|
||||
gContentAPI.getConfiguration("appinfo", (result2) => {
|
||||
ok(typeof(result2.distribution) !== "undefined", "Check distribution isn't undefined.");
|
||||
is(result2.distribution, testDistributionID, "Should have the distribution as set in preference.");
|
||||
gContentAPI.getConfiguration("appinfo", (result) => {
|
||||
ok(typeof(result.distribution) !== "undefined", "Check distribution isn't undefined.");
|
||||
is(result.distribution, testDistributionID, "Should have the distribution as set in preference.");
|
||||
|
||||
done();
|
||||
});
|
||||
|
@ -316,12 +319,12 @@ var tests = [
|
|||
gContentAPI.addNavBarWidget("forget", () => {
|
||||
info("addNavBarWidget callback successfully called");
|
||||
|
||||
let updatedPlacement = CustomizableUI.getPlacementOfWidget("panic-button");
|
||||
is(updatedPlacement.area, CustomizableUI.AREA_NAVBAR);
|
||||
let placement = CustomizableUI.getPlacementOfWidget("panic-button");
|
||||
is(placement.area, CustomizableUI.AREA_NAVBAR);
|
||||
|
||||
gContentAPI.getConfiguration("availableTargets", (data2) => {
|
||||
let updatedAvailable = data2.targets.indexOf("forget") != -1;
|
||||
ok(updatedAvailable, "Forget button should now be available");
|
||||
gContentAPI.getConfiguration("availableTargets", (data) => {
|
||||
let available = (data.targets.indexOf("forget") != -1);
|
||||
ok(available, "Forget button should now be available");
|
||||
|
||||
// Cleanup
|
||||
CustomizableUI.removeWidgetFromArea("panic-button");
|
||||
|
|
|
@ -44,14 +44,14 @@ var tests = [
|
|||
gContentAPI.showInfo("customize", "Customization", "Customize me please!");
|
||||
|
||||
UITour.getTarget(window, "customize").then((customizeTarget) => {
|
||||
waitForPopupAtAnchor(popup, customizeTarget.node, function() {
|
||||
waitForPopupAtAnchor(popup, customizeTarget.node, function checkMenuIsStillOpen() {
|
||||
isnot(PanelUI.panel.state, "closed", "Panel should still be open");
|
||||
ok(PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should still be set");
|
||||
|
||||
// Move the info outside which shouldn't close the app menu since it was manually opened.
|
||||
gContentAPI.showInfo("appMenu", "Open Me", "You know you want to");
|
||||
UITour.getTarget(window, "appMenu").then((target) => {
|
||||
waitForPopupAtAnchor(popup, target.node, function() {
|
||||
waitForPopupAtAnchor(popup, target.node, function checkMenuIsStillOpen() {
|
||||
isnot(PanelUI.panel.state, "closed",
|
||||
"Menu should remain open since UITour didn't open it in the first place");
|
||||
waitForElementToBeHidden(window.PanelUI.panel, () => {
|
||||
|
|
|
@ -43,7 +43,7 @@ var tests = [
|
|||
browserStartupDeferred.resolve(aWindow);
|
||||
}, "browser-delayed-startup-finished", false);
|
||||
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, myDocIdentifier, contentMyDocIdentifier => {
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, myDocIdentifier, myDocIdentifier => {
|
||||
let onVisibilityChange = () => {
|
||||
if (!content.document.hidden) {
|
||||
let win = Cu.waiveXrays(content);
|
||||
|
@ -51,7 +51,7 @@ var tests = [
|
|||
}
|
||||
};
|
||||
content.document.addEventListener("visibilitychange", onVisibilityChange);
|
||||
content.document.myExpando = contentMyDocIdentifier;
|
||||
content.document.myExpando = myDocIdentifier;
|
||||
});
|
||||
gContentAPI.showHighlight("appMenu");
|
||||
|
||||
|
@ -65,8 +65,8 @@ var tests = [
|
|||
yield elementVisiblePromise(newWindowHighlight);
|
||||
|
||||
let selectedTab = gContentWindow.gBrowser.selectedTab;
|
||||
yield ContentTask.spawn(selectedTab.linkedBrowser, myDocIdentifier, contentMyDocIdentifier => {
|
||||
is(content.document.myExpando, contentMyDocIdentifier, "Document should be selected in new window");
|
||||
yield ContentTask.spawn(selectedTab.linkedBrowser, myDocIdentifier, myDocIdentifier => {
|
||||
is(content.document.myExpando, myDocIdentifier, "Document should be selected in new window");
|
||||
});
|
||||
ok(UITour.tourBrowsersByWindow && UITour.tourBrowsersByWindow.has(gContentWindow), "Window should be known");
|
||||
ok(UITour.tourBrowsersByWindow.get(gContentWindow).has(selectedTab.linkedBrowser), "Selected browser should be known");
|
||||
|
|
|
@ -105,10 +105,11 @@ function checkTelemetry(aPayload, aFlowId, aExpectedFields) {
|
|||
* @return {Promise} Resolved with the data that comes with the event.
|
||||
*/
|
||||
function promiseWaitHeartbeatNotification(aEventName) {
|
||||
return ContentTask.spawn(gTestTab.linkedBrowser, aEventName, (aContentEventName) => {
|
||||
return ContentTask.spawn(gTestTab.linkedBrowser, { aEventName },
|
||||
function({ aEventName }) {
|
||||
return new Promise(resolve => {
|
||||
addEventListener("mozUITourNotification", function listener(event) {
|
||||
if (event.detail.event !== aContentEventName) {
|
||||
if (event.detail.event !== aEventName) {
|
||||
return;
|
||||
}
|
||||
removeEventListener("mozUITourNotification", listener, false);
|
||||
|
@ -129,8 +130,9 @@ function promiseWaitHeartbeatNotification(aEventName) {
|
|||
* name of an undesired notification if received.
|
||||
*/
|
||||
function promiseWaitExpectedNotifications(events) {
|
||||
return ContentTask.spawn(gTestTab.linkedBrowser, events, contentEvents => {
|
||||
let stillToReceive = contentEvents;
|
||||
return ContentTask.spawn(gTestTab.linkedBrowser, { events },
|
||||
function({ events }) {
|
||||
let stillToReceive = events;
|
||||
return new Promise((res, rej) => {
|
||||
addEventListener("mozUITourNotification", function listener(event) {
|
||||
if (stillToReceive.includes(event.detail.event)) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче