Backed out changeset 4ff0cbc3329c (bug 1631844) for causing browser-chrome failures at browser/components/urlbar/tests/browser/browser_top_sites.js

This commit is contained in:
Daniel Varga 2020-04-27 17:23:48 +03:00
parent a591f8e572
commit 167993d296
7 changed files with 2 additions and 89 deletions

View File

@ -117,7 +117,6 @@ class ProviderTopSites extends UrlbarProvider {
sites = sites.map(link => ({
type: link.searchTopSite ? "search" : "url",
url: link.url,
isPinned: link.isPinned,
// The newtab page allows the user to set custom site titles, which
// are stored in `label`, so prefer it. Search top sites currently
// don't have titles but `hostname` instead.
@ -135,7 +134,6 @@ class ProviderTopSites extends UrlbarProvider {
title: site.title,
url: site.url,
icon: site.favicon,
isPinned: site.isPinned,
})
);
@ -200,7 +198,6 @@ class ProviderTopSites extends UrlbarProvider {
engine: engine.name,
query: "",
icon: site.favicon,
isPinned: site.isPinned,
})
);
addCallback(this, result);

View File

@ -594,9 +594,6 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = {
icon: {
type: "string",
},
isPinned: {
type: "boolean",
},
inPrivateWindow: {
type: "boolean",
},
@ -636,9 +633,6 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = {
icon: {
type: "string",
},
isPinned: {
type: "boolean",
},
tags: {
type: "array",
items: {

View File

@ -868,12 +868,6 @@ class UrlbarView {
favicon.src = result.payload.icon || UrlbarUtils.ICON.DEFAULT;
}
if (result.payload.isPinned) {
item.toggleAttribute("pinned", true);
} else {
item.removeAttribute("pinned");
}
let title = item._elements.get("title");
this._addTextContentWithHighlights(
title,

View File

@ -5,7 +5,6 @@
XPCOMUtils.defineLazyModuleGetters(this, {
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
PlacesSearchAutocompleteProvider:
"resource://gre/modules/PlacesSearchAutocompleteProvider.jsm",
});
@ -174,7 +173,7 @@ add_task(async function topSitesBookmarksAndTabs() {
Assert.equal(
exampleResult.url,
"http://example.com/",
"The example.com Top Site should be the first result."
"The example.com Top Site should be the second result."
);
Assert.equal(
exampleResult.source,
@ -186,7 +185,7 @@ add_task(async function topSitesBookmarksAndTabs() {
Assert.equal(
youtubeResult.url,
"https://www.youtube.com/",
"The YouTube Top Site should be the second result."
"The YouTube Top Site should be the third result."
);
Assert.equal(
youtubeResult.source,
@ -246,56 +245,6 @@ add_task(async function topSitesKeywordNavigationPageproxystate() {
);
});
add_task(async function topSitesPinned() {
let info = { url: "http://example.com/" };
NewTabUtils.pinnedLinks.pin(info, 0);
await updateTopSites(sites => sites && sites[0] && sites[0].isPinned);
let sites = AboutNewTab.getTopSites();
Assert.equal(
sites.length,
7,
"The test suite browser should have 7 Top Sites."
);
await UrlbarTestUtils.promisePopupOpen(window, () => {
EventUtils.synthesizeMouseAtCenter(window.gURLBar.inputField, {});
});
Assert.ok(window.gURLBar.view.isOpen, "UrlbarView should be open.");
await UrlbarTestUtils.promiseSearchComplete(window);
Assert.equal(
UrlbarTestUtils.getResultCount(window),
7,
"The number of results should be the same as the number of Top Sites (7)."
);
let exampleResult = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
Assert.equal(
exampleResult.url,
"http://example.com/",
"The example.com Top Site should be the first result."
);
Assert.equal(
exampleResult.source,
UrlbarUtils.RESULT_SOURCE.TABS,
"The example.com Top Site should be an open tab result."
);
Assert.equal(
exampleResult.element.row.getAttribute("pinned"),
"true",
"The example.com Top Site should be displayed as a pinned site."
);
await UrlbarTestUtils.promisePopupClose(window, () => {
window.gURLBar.blur();
});
NewTabUtils.pinnedLinks.unpin(info);
});
add_task(async function topSitesDisabled() {
// Disable top sites.
await SpecialPowers.pushPrefEnv({

View File

@ -1,7 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12">
<path d="M10.2 11.5c-.3 0-.6-.1-.9-.4l-2-2-1.2 1.2c-.2.2-.5.4-.9.4-.3 0-.6-.1-.8-.3-.7-.6-1.1-1.6-1.1-2.6v-.1c0-.7-.5-1.2-1.2-1.2h-.4c-.3 0-.6-.1-.9-.4-.2-.2-.3-.5-.3-.8 0-.3.1-.6.4-.9L4.5.8c.2-.2.5-.4.9-.4.7 0 1.2.5 1.2 1.2V2c0 .7.5 1.2 1.2 1.2h.1c1 0 1.9.4 2.6 1.1.5.5.5 1.2 0 1.7L9.2 7.4l2 2c.5.5.5 1.3 0 1.8-.3.2-.6.3-1 .3z" fill="context-fill"/>
<path d="M5.3 1c.4 0 .7.3.7.7v.4c0 .9.8 1.7 1.7 1.7h.1c.8 0 1.6.3 2.2.9.3.3.3.7 0 1L8.4 7.4l2.3 2.3c.3.3.3.8 0 1.1-.2.2-.4.2-.6.2-.2 0-.4-.1-.5-.2L7.4 8.4 5.8 10c-.1.1-.3.2-.5.2s-.3-.1-.5-.2c-.6-.6-1-1.4-.9-2.2v-.1C3.8 6.7 3.1 6 2.1 6h-.4c-.2 0-.4-.1-.5-.2-.3-.3-.3-.7 0-1l3.6-3.6c.1-.1.3-.2.5-.2m0-1c-.5 0-.9.2-1.2.5L.5 4.1c-.3.3-.5.7-.5 1.2s.2.9.5 1.2c.3.3.8.5 1.2.5h.4c.4 0 .7.3.7.7v.1c0 1.1.4 2.2 1.3 3 .3.3.7.4 1.1.4.5 0 .9-.2 1.2-.5l.9-.9L9 11.5c.3.3.8.5 1.2.5.5 0 .9-.2 1.3-.5.7-.7.7-1.8 0-2.5L9.9 7.4l.9-.9c.7-.7.7-1.8 0-2.4-.8-.8-1.9-1.3-3-1.3h-.1c-.4 0-.7-.3-.7-.7v-.4c0-.5-.2-.9-.5-1.2C6.2.2 5.7 0 5.3 0z" fill="context-stroke"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -202,7 +202,6 @@
skin/classic/browser/new-window.svg (../shared/icons/new-window.svg)
skin/classic/browser/open.svg (../shared/icons/open.svg)
skin/classic/browser/open-in-new.svg (../shared/icons/open-in-new.svg)
skin/classic/browser/pin-12.svg (../shared/icons/pin-12.svg)
skin/classic/browser/pin-tab.svg (../shared/icons/pin-tab.svg)
skin/classic/browser/pocket.svg (../shared/icons/pocket.svg)
skin/classic/browser/pocket-animation.svg (../shared/icons/pocket-animation.svg)

View File

@ -203,20 +203,12 @@
-moz-context-properties: fill, stroke;
}
/* Favicon badges have this priority: switchtab/remotetab > pinned > bookmark. */
.urlbarView-row[type=bookmark] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
background-image: url(chrome://browser/skin/bookmark-12.svg);
color: #0060df; /* Blue-60 */
stroke: #fff;
}
.urlbarView-row[pinned] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
background-image: url(chrome://browser/skin/pin-12.svg);
color: #b1b1b3; /* Grey-40 */
stroke: #fff;
}
.urlbarView:not([actionoverride]) .urlbarView-row[type=switchtab] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon,
.urlbarView-row[type=remotetab] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
background-image: url(chrome://browser/skin/tab-12.svg);
@ -229,11 +221,6 @@
stroke: #38383d; /* Grey-70 */
}
:root[lwt-toolbar-field-brighttext] .urlbarView-row[pinned] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
color: #d7d7db; /* Grey-30 */
stroke: #38383d; /* Grey-70 */
}
:root[lwt-toolbar-field-brighttext] .urlbarView:not([actionoverride]) .urlbarView-row[type=switchtab] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon,
:root[lwt-toolbar-field-brighttext] .urlbarView-row[type=remotetab] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
color: #00c8d7; /* Teal-60 */