Skip to content

Commit ffe70d3

Browse files
Merge mozilla-central to mozilla-inbound
2 parents 8d609a0 + 756cf90 commit ffe70d3

File tree

390 files changed

+5995
-22385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+5995
-22385
lines changed

browser/base/content/browser.js

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,24 +2878,6 @@ var BrowserOnClick = {
28782878
}
28792879
},
28802880

2881-
handleEvent(event) {
2882-
if (!event.isTrusted || // Don't trust synthetic events
2883-
event.button == 2) {
2884-
return;
2885-
}
2886-
2887-
let originalTarget = event.originalTarget;
2888-
let ownerDoc = originalTarget.ownerDocument;
2889-
if (!ownerDoc) {
2890-
return;
2891-
}
2892-
2893-
if (gMultiProcessBrowser &&
2894-
ownerDoc.documentURI.toLowerCase() == "about:newtab") {
2895-
this.onE10sAboutNewTab(event, ownerDoc);
2896-
}
2897-
},
2898-
28992881
receiveMessage(msg) {
29002882
switch (msg.name) {
29012883
case "Browser:CertExceptionError":
@@ -3082,28 +3064,6 @@ var BrowserOnClick = {
30823064
}
30833065
},
30843066

3085-
/**
3086-
* This functions prevents navigation from happening directly through the <a>
3087-
* link in about:newtab (which is loaded in the parent and therefore would load
3088-
* the next page also in the parent) and instructs the browser to open the url
3089-
* in the current tab which will make it update the remoteness of the tab.
3090-
*/
3091-
onE10sAboutNewTab(event, ownerDoc) {
3092-
let isTopFrame = (ownerDoc.defaultView.parent === ownerDoc.defaultView);
3093-
if (!isTopFrame) {
3094-
return;
3095-
}
3096-
3097-
let anchorTarget = event.originalTarget.parentNode;
3098-
3099-
if (anchorTarget instanceof HTMLAnchorElement &&
3100-
anchorTarget.classList.contains("newtab-link")) {
3101-
event.preventDefault();
3102-
let where = whereToOpenLink(event, false, false);
3103-
openLinkIn(anchorTarget.href, where, { charset: ownerDoc.characterSet, referrerURI: ownerDoc.documentURIObject });
3104-
}
3105-
},
3106-
31073067
ignoreWarningButton(reason) {
31083068
// Allow users to override and continue through to the site,
31093069
// but add a notify bar as a reminder, so that they don't lose
@@ -4924,13 +4884,9 @@ var TabsProgressListener = {
49244884
}
49254885
}
49264886

4927-
// Attach a listener to watch for "click" events bubbling up from error
4928-
// pages and other similar pages (like about:newtab). This lets us fix bugs
4929-
// like 401575 which require error page UI to do privileged things, without
4930-
// letting error pages have any privilege themselves.
4931-
// We can't look for this during onLocationChange since at that point the
4932-
// document URI is not yet the about:-uri of the error page.
4933-
4887+
// We used to listen for clicks in the browser here, but when that
4888+
// became unnecessary, removing the code below caused focus issues.
4889+
// This code should be removed. Tracked in bug 1337794.
49344890
let isRemoteBrowser = aBrowser.isRemoteBrowser;
49354891
// We check isRemoteBrowser here to avoid requesting the doc CPOW
49364892
let doc = isRemoteBrowser ? null : aWebProgress.DOMWindow.document;
@@ -4945,11 +4901,9 @@ var TabsProgressListener = {
49454901
// STATE_STOP may be received twice for documents, thus store an
49464902
// attribute to ensure handling it just once.
49474903
doc.documentElement.setAttribute("hasBrowserHandlers", "true");
4948-
aBrowser.addEventListener("click", BrowserOnClick, true);
49494904
aBrowser.addEventListener("pagehide", function onPageHide(event) {
49504905
if (event.target.defaultView.frameElement)
49514906
return;
4952-
aBrowser.removeEventListener("click", BrowserOnClick, true);
49534907
aBrowser.removeEventListener("pagehide", onPageHide, true);
49544908
if (event.target.documentElement)
49554909
event.target.documentElement.removeAttribute("hasBrowserHandlers");

browser/base/content/test/general/browser.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ support-files =
8181
browser_webext_update2.xpi
8282
browser_webext_update_icon1.xpi
8383
browser_webext_update_icon2.xpi
84+
browser_webext_update_perms1.xpi
85+
browser_webext_update_perms2.xpi
8486
browser_webext_update.json
8587
!/image/test/mochitest/blue.png
8688
!/toolkit/content/tests/browser/common/mockTransfer.js
@@ -252,7 +254,8 @@ skip-if = os == "mac" # decoder doctor isn't implemented on osx
252254
skip-if = true # browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
253255
[browser_extension_permissions.js]
254256
[browser_extension_sideloading.js]
255-
[browser_extension_update.js]
257+
[browser_extension_update_background.js]
258+
[browser_extension_update_interactive.js]
256259
[browser_favicon_change.js]
257260
[browser_favicon_change_not_in_document.js]
258261
[browser_findbarClose.js]
@@ -349,7 +352,7 @@ skip-if = os == 'linux' # Bug 1304272
349352
[browser_tab_detach_restore.js]
350353
[browser_tab_drag_drop_perwindow.js]
351354
[browser_tab_dragdrop.js]
352-
skip-if = buildapp == 'mulet' || (e10s && (debug || asan)) # Bug 1312436
355+
skip-if = buildapp == 'mulet' || (e10s && (debug || os == 'linux')) # Bug 1312436
353356
[browser_tab_dragdrop2.js]
354357
[browser_tabbar_big_widgets.js]
355358
skip-if = os == "linux" || os == "mac" # No tabs in titlebar on linux

browser/base/content/test/general/browser_extension_sideloading.js

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,6 @@ class MockProvider {
7171
}
7272
}
7373

74-
function promiseViewLoaded(tab, viewid) {
75-
let win = tab.linkedBrowser.contentWindow;
76-
if (win.gViewController && !win.gViewController.isLoading &&
77-
win.gViewController.currentViewId == viewid) {
78-
return Promise.resolve();
79-
}
80-
81-
return new Promise(resolve => {
82-
function listener() {
83-
if (win.gViewController.currentViewId != viewid) {
84-
return;
85-
}
86-
win.document.removeEventListener("ViewChanged", listener);
87-
resolve();
88-
}
89-
win.document.addEventListener("ViewChanged", listener);
90-
});
91-
}
92-
9374
function promisePopupNotificationShown(name) {
9475
return new Promise(resolve => {
9576
function popupshown() {
@@ -169,6 +150,17 @@ add_task(function* () {
169150
ExtensionsUI.emit("change");
170151
});
171152

153+
// Navigate away from the starting page to force about:addons to load
154+
// in a new tab during the tests below.
155+
gBrowser.selectedBrowser.loadURI("about:robots");
156+
yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
157+
158+
registerCleanupFunction(function*() {
159+
// Return to about:blank when we're done
160+
gBrowser.selectedBrowser.loadURI("about:blank");
161+
yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
162+
});
163+
172164
let changePromise = new Promise(resolve => {
173165
ExtensionsUI.on("change", function listener() {
174166
ExtensionsUI.off("change", listener);
@@ -189,22 +181,20 @@ add_task(function* () {
189181
is(addons.children.length, 2, "Have 2 menu entries for sideloaded extensions");
190182

191183
// Click the first sideloaded extension
192-
let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "about:addons");
193184
let popupPromise = promisePopupNotificationShown("addon-webext-permissions");
194185
addons.children[0].click();
195186

196-
// about:addons should load and go to the list of extensions
197-
let tab = yield tabPromise;
198-
is(tab.linkedBrowser.currentURI.spec, "about:addons", "Newly opened tab is at about:addons");
187+
// When we get the permissions prompt, we should be at the extensions
188+
// list in about:addons
189+
let panel = yield popupPromise;
190+
is(gBrowser.currentURI.spec, "about:addons", "Foreground tab is at about:addons");
199191

200192
const VIEW = "addons://list/extension";
201-
yield promiseViewLoaded(tab, VIEW);
202-
let win = tab.linkedBrowser.contentWindow;
193+
let win = gBrowser.selectedBrowser.contentWindow;
203194
ok(!win.gViewController.isLoading, "about:addons view is fully loaded");
204195
is(win.gViewController.currentViewId, VIEW, "about:addons is at extensions list");
205196

206-
// Wait for the permission prompt and cancel it
207-
let panel = yield popupPromise;
197+
// Check the contents of the notification, then choose "Cancel"
208198
let icon = panel.getAttribute("icon");
209199
is(icon, ICON_URL, "Permissions notification has the addon icon");
210200

@@ -219,31 +209,29 @@ add_task(function* () {
219209
is(addon1.userDisabled, true, "Addon 1 should still be disabled");
220210
is(addon2.userDisabled, true, "Addon 2 should still be disabled");
221211

222-
yield BrowserTestUtils.removeTab(tab);
212+
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
223213

224214
// Should still have 1 entry in the hamburger menu
225215
yield PanelUI.show();
226216

227217
addons = document.getElementById("PanelUI-footer-addons");
228218
is(addons.children.length, 1, "Have 1 menu entry for sideloaded extensions");
229219

230-
// Click the second sideloaded extension
231-
tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "about:addons");
220+
// Click the second sideloaded extension and wait for the notification
232221
popupPromise = promisePopupNotificationShown("addon-webext-permissions");
233222
addons.children[0].click();
234-
235-
tab = yield tabPromise;
236-
is(tab.linkedBrowser.currentURI.spec, "about:addons", "Newly opened tab is at about:addons");
223+
panel = yield popupPromise;
237224

238225
isnot(menuButton.getAttribute("badge-status"), "addon-alert", "Should no longer have addon alert badge");
239226

240-
yield promiseViewLoaded(tab, VIEW);
241-
win = tab.linkedBrowser.contentWindow;
227+
// Again we should be at the extentions list in about:addons
228+
is(gBrowser.currentURI.spec, "about:addons", "Foreground tab is at about:addons");
229+
230+
win = gBrowser.selectedBrowser.contentWindow;
242231
ok(!win.gViewController.isLoading, "about:addons view is fully loaded");
243232
is(win.gViewController.currentViewId, VIEW, "about:addons is at extensions list");
244233

245-
// Wait for the permission prompt and accept it this time
246-
panel = yield popupPromise;
234+
// Check the notification contents, this time accept the install
247235
icon = panel.getAttribute("icon");
248236
is(icon, DEFAULT_ICON_URL, "Permissions notification has the default icon");
249237
disablePromise = promiseSetDisabled(mock2);
@@ -256,5 +244,5 @@ add_task(function* () {
256244
is(addon1.userDisabled, true, "Addon 1 should still be disabled");
257245
is(addon2.userDisabled, false, "Addon 2 should now be enabled");
258246

259-
yield BrowserTestUtils.removeTab(tab);
247+
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
260248
});

0 commit comments

Comments
 (0)