Skip to content

Commit

Permalink
Merge inbound to mozilla-central r=merge a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreeaPavel committed Dec 9, 2017
2 parents 8c8e64b + 6058ba5 commit 5ba2665
Show file tree
Hide file tree
Showing 229 changed files with 3,791 additions and 1,605 deletions.
3 changes: 3 additions & 0 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"phabricator.uri" : "https://phabricator.services.mozilla.com/"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* globals windowTracker */
/* globals windowTracker */

"use strict";

Expand Down Expand Up @@ -170,8 +170,9 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
// Needs to be called every time to handle reenabling, but
// only sets default for install or enable.
await this.setDefault(engineName);
} else if (ExtensionSettingsStore.hasSetting(
extension.id, DEFAULT_SEARCH_STORE_TYPE, DEFAULT_SEARCH_SETTING_NAME)) {
} else if (ExtensionSettingsStore.hasSetting(extension.id,
DEFAULT_SEARCH_STORE_TYPE,
DEFAULT_SEARCH_SETTING_NAME)) {
// is_default has been removed, but we still have a setting. Remove it.
chrome_settings_overrides.processDefaultSearchSetting("removeSetting", extension.id);
}
Expand Down
3 changes: 1 addition & 2 deletions browser/components/extensions/ext-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ var gMenuBuilder = {
}

if (item.id && item.extension && item.extension.id) {
element.setAttribute("id",
`${makeWidgetId(item.extension.id)}_${item.id}`);
element.setAttribute("id", `${makeWidgetId(item.extension.id)}_${item.id}`);
}

if (item.icons) {
Expand Down
7 changes: 3 additions & 4 deletions browser/components/extensions/ext-pkcs11.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ XPCOMUtils.defineLazyModuleGetters(this, {
OS: "resource://gre/modules/osfile.jsm",
});

XPCOMUtils.defineLazyServiceGetter(this,
"pkcs11db",
"@mozilla.org/security/pkcs11moduledb;1",
"nsIPKCS11ModuleDB");
XPCOMUtils.defineLazyServiceGetter(this, "pkcs11db",
"@mozilla.org/security/pkcs11moduledb;1",
"nsIPKCS11ModuleDB");

var {DefaultMap} = ExtensionUtils;

Expand Down
4 changes: 2 additions & 2 deletions browser/components/extensions/ext-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ this.windows = class extends ExtensionAPI {
if (allowScriptsToClose) {
for (let {linkedBrowser} of window.gBrowser.tabs) {
onXULFrameLoaderCreated({target: linkedBrowser});
linkedBrowser.addEventListener( // eslint-disable-line mozilla/balanced-listeners
"XULFrameLoaderCreated", onXULFrameLoaderCreated);
// eslint-disable-next-line mozilla/balanced-listeners
linkedBrowser.addEventListener("XULFrameLoaderCreated", onXULFrameLoaderCreated);
}
}
if (createData.titlePreface !== null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ add_task(async function testBrowserActionPopupResize() {
Assert.lessOrEqual(Math.abs(dims.window.innerHeight - expected), 1,
`Panel window should be ${expected}px tall (was ${dims.window.innerHeight})`);
is(dims.body.clientHeight, dims.body.scrollHeight,
"Panel body should be tall enough to fit its contents");
"Panel body should be tall enough to fit its contents");

// Tolerate if it is 1px too wide, as that may happen with the current resizing method.
Assert.lessOrEqual(Math.abs(dims.window.innerWidth - expected), 1,
`Panel window should be ${expected}px wide`);
is(dims.body.clientWidth, dims.body.scrollWidth,
"Panel body should be wide enough to fit its contents");
"Panel body should be wide enough to fit its contents");
}

/* eslint-disable mozilla/no-cpows-in-tests */
Expand Down Expand Up @@ -162,7 +162,7 @@ async function testPopupSize(standardsMode, browserWin = window, arrowSide = "to
// The 'ViewShown' event is the only way to correctly determine when the extensions'
// panelview has finished transitioning and is fully in view.
let shownPromise = BrowserTestUtils.waitForEvent(panelMultiView, "ViewShown",
e => (e.originalTarget.id || "").includes(widgetId));
e => (e.originalTarget.id || "").includes(widgetId));
let browser = await openPanel(extension, browserWin);
let origPanelRect = panel.getBoundingClientRect();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ add_task(async function testBrowserActionTelemetryTiming() {
histogram.clear();

is(histogram.snapshot().sum, 0,
`No data recorded for histogram: ${TIMING_HISTOGRAM}.`);
`No data recorded for histogram: ${TIMING_HISTOGRAM}.`);

await extension1.startup();
await extension2.startup();

is(histogram.snapshot().sum, 0,
`No data recorded for histogram after startup: ${TIMING_HISTOGRAM}.`);
`No data recorded for histogram after startup: ${TIMING_HISTOGRAM}.`);

clickBrowserAction(extension1);
await awaitExtensionPanel(extension1);
Expand Down Expand Up @@ -117,7 +117,7 @@ add_task(async function testBrowserActionTelemetryResults() {
histogram.clear();

is(histogram.snapshot().sum, 0,
`No data recorded for histogram: ${TIMING_HISTOGRAM}.`);
`No data recorded for histogram: ${TIMING_HISTOGRAM}.`);

await extension.startup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]],
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ add_task(async function test_bookmark_contextmenu() {
});
await extension.startup();
await extension.awaitMessage("bookmark-created");
let menu = await openChromeContextMenu("placesContext",
let menu = await openChromeContextMenu(
"placesContext",
"#PersonalToolbar .bookmark-item:last-child");

let menuItem = menu.getElementsByAttribute("label", "Get bookmark")[0];
Expand Down Expand Up @@ -515,11 +516,12 @@ add_task(async function test_bookmark_context_requires_permission() {
});
await extension.startup();
await extension.awaitMessage("bookmark-created");
let menu = await openChromeContextMenu("placesContext",
let menu = await openChromeContextMenu(
"placesContext",
"#PersonalToolbar .bookmark-item:last-child");

Assert.equal(menu.getElementsByAttribute("label", "Get bookmark").length, 0,
"bookmark context menu not created with `bookmarks` permission.");
"bookmark context menu not created with `bookmarks` permission.");

closeChromeContextMenu("placesContext");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"use strict";

add_task(async function() {
let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser,
let tab1 = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"http://mochi.test:8888/browser/browser/components/extensions/test/browser/context.html");

gBrowser.selectedTab = tab1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function testScript() {
// Sanity check - the pages must be in the same process.
let pages = browser.extension.getViews();
browser.test.assertTrue(pages.includes(window),
"Expected this tab to be an extension view");
"Expected this tab to be an extension view");
pages = pages.filter(w => w !== window);
browser.test.assertEq(pages[0], browser.extension.getBackgroundPage(),
"Expected the other page to be a background page");
"Expected the other page to be a background page");
browser.test.sendMessage("tab.html ready");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"use strict";

add_task(async function() {
let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser,
let tab1 = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"http://mochi.test:8888/browser/browser/components/extensions/test/browser/context.html");

gBrowser.selectedTab = tab1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"use strict";

add_task(async function() {
let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser,
let tab1 = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"http://mochi.test:8888/browser/browser/components/extensions/test/browser/context.html");

// Install an extension.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"use strict";

add_task(async function() {
let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser,
let tab1 = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"http://mochi.test:8888/browser/browser/components/extensions/test/browser/context.html");

let extension = ExtensionTestUtils.loadExtension({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ add_task(async function test_devtools_inspectedWindow_tabId() {
}

function devtools_page() {
browser.test.assertEq(undefined, browser.runtime.getBackgroundPage,
"The `runtime.getBackgroundPage` API method should be missing in a devtools_page context"
);
browser.test.assertEq(
undefined, browser.runtime.getBackgroundPage,
"The `runtime.getBackgroundPage` API method should be missing in a devtools_page context");

try {
let tabId = browser.devtools.inspectedWindow.tabId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ add_task(async function test_devtools_inspectedWindow_eval_bindings() {
const objectPreviewProperties = options.objectActor.preview.ownProperties;
is(objectType, "object", "The inspected object has the expected type");
Assert.deepEqual(Object.keys(objectPreviewProperties), ["testkey"],
"The inspected object has the expected preview properties");
"The inspected object has the expected preview properties");
}
})();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ add_task(async function test_devtools_inspectedWindow_reload_custom_user_agent()
try {
const [text] = await browser.tabs.executeScript(activeTabId, {code});
browser.test.assertEq(expectedContent, text,
`Got the expected userAgent with userAgent=${enabled}`);
`Got the expected userAgent with userAgent=${enabled}`);
} catch (err) {
browser.test.fail(`Error: ${err.message} - ${err.stack}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ async function testThemeSwitching(extension, locations = ["page"]) {
await switchTheme(newTheme);
for (let location of locations) {
is(await extension.awaitMessage(`devtools_theme_changed_${location}`),
newTheme,
`The onThemeChanged event listener fired for the ${location}.`);
newTheme,
`The onThemeChanged event listener fired for the ${location}.`);
is(await extension.awaitMessage(`current_theme_${location}`),
newTheme,
`The current theme is reported as expected for the ${location}.`);
newTheme,
`The current theme is reported as expected for the ${location}.`);
}
}
}
Expand Down Expand Up @@ -80,8 +80,8 @@ add_task(async function test_theme_name_no_panel() {
info("developer toolbox opened");

is(await extension.awaitMessage("initial_theme"),
"light",
"The initial theme is reported as expected.");
"light",
"The initial theme is reported as expected.");

await testThemeSwitching(extension);

Expand Down Expand Up @@ -201,8 +201,8 @@ add_task(async function test_devtools_page_panels_create() {

await extension.awaitMessage("devtools_panel_created");
is(await extension.awaitMessage("initial_theme_page"),
"light",
"The initial theme is reported as expected from a devtools page.");
"light",
"The initial theme is reported as expected from a devtools page.");

const toolboxAdditionalTools = toolbox.getAdditionalTools();

Expand All @@ -220,8 +220,8 @@ add_task(async function test_devtools_page_panels_create() {
is(devtoolsPanelTabId, devtoolsPageTabId,
"Got the same devtools.inspectedWindow.tabId from devtools page and panel");
is(await extension.awaitMessage("initial_theme_panel"),
"light",
"The initial theme is reported as expected from a devtools panel.");
"light",
"The initial theme is reported as expected from a devtools panel.");
info("Addon Devtools Panel shown");

await testThemeSwitching(extension, ["page", "panel"]);
Expand Down Expand Up @@ -282,8 +282,8 @@ add_task(async function test_devtools_page_panels_create() {
await gDevTools.showToolbox(target, panelId);
await extension.awaitMessage("devtools_panel_shown");
is(await extension.awaitMessage("initial_theme_panel"),
"light",
"The initial theme is reported as expected from a devtools panel.");
"light",
"The initial theme is reported as expected from a devtools panel.");
info("Addon Devtools Panel shown - after visibilityswitch toggled");

info("Wait until the Addon Devtools Panel has been loaded - after visibilityswitch toggled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ add_task(async function test_legacy_extension_context_contentscript_connection()
function contentScript() {
browser.runtime.sendMessage("webextension -> legacy_extension message", (reply) => {
browser.test.assertEq("legacy_extension -> webextension reply", reply,
"Got the expected reply from the LegacyExtensionContext");
"Got the expected reply from the LegacyExtensionContext");
browser.test.sendMessage("got-reply-message");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ add_task(async function() {
let actual = await extension.awaitMessage(event);
if (expected.text) {
is(actual.text, expected.text,
`Expected "${event}" to have fired with text: "${expected.text}".`);
`Expected "${event}" to have fired with text: "${expected.text}".`);
}
if (expected.disposition) {
is(actual.disposition, expected.disposition,
`Expected "${event}" to have fired with disposition: "${expected.disposition}".`);
`Expected "${event}" to have fired with disposition: "${expected.disposition}".`);
}
}

Expand Down Expand Up @@ -205,10 +205,10 @@ add_task(async function() {
let item = gURLBar.popup.richlistbox.children[0];

is(item.getAttribute("title"), expectedText,
`Expected heuristic result to have title: "${expectedText}".`);
`Expected heuristic result to have title: "${expectedText}".`);

is(item.getAttribute("displayurl"), `${keyword} ${text}`,
`Expected heuristic result to have displayurl: "${keyword} ${text}".`);
`Expected heuristic result to have displayurl: "${keyword} ${text}".`);

let promiseEvent = expectEvent("on-input-entered-fired", {
text,
Expand Down Expand Up @@ -250,10 +250,10 @@ add_task(async function() {

ok(!!item, "Expected item to exist");
is(item.getAttribute("title"), description,
`Expected suggestion to have title: "${description}".`);
`Expected suggestion to have title: "${description}".`);

is(item.getAttribute("displayurl"), `${keyword} ${content}`,
`Expected suggestion to have displayurl: "${keyword} ${content}".`);
`Expected suggestion to have displayurl: "${keyword} ${content}".`);
}

let text = await startInputSession(info.suggestions.length - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ add_task(async function testPageActionPopupResize() {

is(dims.window.innerHeight, expected, `Panel window should be ${expected}px tall`);
is(body.clientHeight, body.scrollHeight,
"Panel body should be tall enough to fit its contents");
"Panel body should be tall enough to fit its contents");
is(root.clientHeight, root.scrollHeight,
"Panel root should be tall enough to fit its contents");
"Panel root should be tall enough to fit its contents");

// Tolerate if it is 1px too wide, as that may happen with the current resizing method.
ok(Math.abs(dims.window.innerWidth - expected) <= 1, `Panel window should be ${expected}px wide`);
Expand Down Expand Up @@ -141,9 +141,9 @@ add_task(async function testPageActionPopupReflow() {
`Panel window height (${dims.window.innerHeight}px) should be taller than two lines of text.`);

is(dims.body.clientHeight, dims.body.scrollHeight,
"Panel body should be tall enough to fit its contents");
"Panel body should be tall enough to fit its contents");
is(dims.root.clientHeight, dims.root.scrollHeight,
"Panel root should be tall enough to fit its contents");
"Panel root should be tall enough to fit its contents");

await extension.unload();
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_task(async function test_sessions_forget_closed_tab() {
},
error => {
browser.test.assertEq(error.message,
`Could not find closed tab using sessionId ${sessionId}.`);
`Could not find closed tab using sessionId ${sessionId}.`);
browser.test.sendMessage("forget-reject");
}
);
Expand Down Expand Up @@ -45,8 +45,9 @@ add_task(async function test_sessions_forget_closed_tab() {
let recentlyClosedTab = recentlyClosed[0].tab;

// Check that forgetting a tab works properly
extension.sendMessage("forget-tab", recentlyClosedTab.windowId,
recentlyClosedTab.sessionId);
extension.sendMessage("forget-tab",
recentlyClosedTab.windowId,
recentlyClosedTab.sessionId);
await extension.awaitMessage("forgot-tab");
extension.sendMessage("check-sessions");
let remainingClosed = await extension.awaitMessage("recentlyClosed");
Expand All @@ -56,8 +57,9 @@ add_task(async function test_sessions_forget_closed_tab() {
"The correct tab was forgotten.");

// Check that re-forgetting the same tab fails properly
extension.sendMessage("forget-tab", recentlyClosedTab.windowId,
recentlyClosedTab.sessionId);
extension.sendMessage("forget-tab",
recentlyClosedTab.windowId,
recentlyClosedTab.sessionId);
await extension.awaitMessage("forget-reject");
extension.sendMessage("check-sessions");
remainingClosed = await extension.awaitMessage("recentlyClosed");
Expand Down
Loading

0 comments on commit 5ba2665

Please sign in to comment.