Skip to content

Commit 57db0ea

Browse files
committed
Bug 1869836 - Rename files with Firefox View Next to Firefox View. r=fxview-reviewers,sfoster
- rename files to exclude "next" suffix - move tests out of firefoxview-next folder into parent folder - updat AboutRedirector to point at firefoxview.html - this patch also resolves Bug 1872919 by adding a scroll into view during the `search_synced_tabs_recent_browsing` test Differential Revision: https://phabricator.services.mozilla.com/D196347
1 parent b80b016 commit 57db0ea

26 files changed

+119
-151
lines changed

browser/components/about/AboutRedirector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ static const RedirEntry kRedirMap[] = {
7474
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
7575
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
7676
nsIAboutModule::IS_SECURE_CHROME_UI},
77-
{"firefoxview",
78-
"chrome://browser/content/firefoxview/firefoxview-next.html",
77+
{"firefoxview", "chrome://browser/content/firefoxview/firefoxview.html",
7978
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
8079
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
8180
{"policies", "chrome://browser/content/policies/aboutPolicies.html",

browser/components/firefoxview/firefoxview-next.html renamed to browser/components/firefoxview/firefoxview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<link rel="localization" href="browser/migrationWizard.ftl" />
2222
<link
2323
rel="stylesheet"
24-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
24+
href="chrome://browser/content/firefoxview/firefoxview.css"
2525
/>
2626
<script
2727
type="module"
@@ -113,6 +113,6 @@ <h1 slot="category-nav-header" data-l10n-id="firefoxview-page-title"></h1>
113113
</named-deck>
114114
</div>
115115
</main>
116-
<script src="chrome://browser/content/firefoxview/firefoxview-next.mjs"></script>
116+
<script src="chrome://browser/content/firefoxview/firefoxview.mjs"></script>
117117
</body>
118118
</html>

browser/components/firefoxview/history.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class HistoryInView extends ViewPage {
531531
return html`
532532
<link
533533
rel="stylesheet"
534-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
534+
href="chrome://browser/content/firefoxview/firefoxview.css"
535535
/>
536536
<link
537537
rel="stylesheet"

browser/components/firefoxview/jar.mn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
browser.jar:
66
content/browser/firefoxview/card-container.css
77
content/browser/firefoxview/card-container.mjs
8-
content/browser/firefoxview/firefoxview-next.html
9-
content/browser/firefoxview/firefoxview-next.mjs
8+
content/browser/firefoxview/firefoxview.html
9+
content/browser/firefoxview/firefoxview.mjs
1010
content/browser/firefoxview/history.css
1111
content/browser/firefoxview/history.mjs
1212
content/browser/firefoxview/opentabs.mjs
1313
content/browser/firefoxview/view-opentabs.css
1414
content/browser/firefoxview/syncedtabs.mjs
1515
content/browser/firefoxview/view-syncedtabs.css
1616
content/browser/firefoxview/recentbrowsing.mjs
17-
content/browser/firefoxview/firefoxview-next.css
17+
content/browser/firefoxview/firefoxview.css
1818
content/browser/firefoxview/fxview-category-button.css
1919
content/browser/firefoxview/fxview-category-navigation.css
2020
content/browser/firefoxview/fxview-category-navigation.mjs

browser/components/firefoxview/moz.build

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ TESTING_JS_MODULES += [
1717
"tests/browser/FirefoxViewTestUtils.sys.mjs",
1818
]
1919

20-
BROWSER_CHROME_MANIFESTS += [
21-
"tests/browser/browser.toml",
22-
"tests/browser/firefoxview-next/browser.toml",
23-
]
20+
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
2421

2522
MOCHITEST_CHROME_MANIFESTS += ["tests/chrome/chrome.toml"]

browser/components/firefoxview/opentabs.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class OpenTabsInView extends ViewPage {
205205
/>
206206
<link
207207
rel="stylesheet"
208-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
208+
href="chrome://browser/content/firefoxview/firefoxview.css"
209209
/>
210210
<div class="sticky-container bottom-fade">
211211
<h2
@@ -498,7 +498,7 @@ class OpenTabsInViewCard extends ViewPageContent {
498498
return html`
499499
<link
500500
rel="stylesheet"
501-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
501+
href="chrome://browser/content/firefoxview/firefoxview.css"
502502
/>
503503
<card-container
504504
?preserveCollapseState=${this.recentBrowsing}
@@ -725,7 +725,7 @@ class OpenTabsContextMenu extends MozLitElement {
725725
return html`
726726
<link
727727
rel="stylesheet"
728-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
728+
href="chrome://browser/content/firefoxview/firefoxview.css"
729729
/>
730730
<panel-list data-tab-type="opentabs">
731731
<panel-item

browser/components/firefoxview/recentbrowsing.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class RecentBrowsingInView extends ViewPage {
4040
return html`
4141
<link
4242
rel="stylesheet"
43-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
43+
href="chrome://browser/content/firefoxview/firefoxview.css"
4444
/>
4545
<div class="sticky-container bottom-fade">
4646
<h2

browser/components/firefoxview/recentlyclosed.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class RecentlyClosedTabsInView extends ViewPage {
329329
return html`
330330
<link
331331
rel="stylesheet"
332-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
332+
href="chrome://browser/content/firefoxview/firefoxview.css"
333333
/>
334334
${when(
335335
!this.recentBrowsing,

browser/components/firefoxview/syncedtabs.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ class SyncedTabsInView extends ViewPage {
549549
/>`);
550550
renderArray.push(html` <link
551551
rel="stylesheet"
552-
href="chrome://browser/content/firefoxview/firefoxview-next.css"
552+
href="chrome://browser/content/firefoxview/firefoxview.css"
553553
/>`);
554554

555555
if (!this.recentBrowsing) {

browser/components/firefoxview/tests/browser/browser.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,34 @@ skip-if = ["true"] # Bug 1851453
3737
["browser_tab_close_last_tab.js"]
3838

3939
["browser_tab_on_close_warning.js"]
40+
41+
["browser_firefoxview_paused.js"]
42+
43+
["browser_firefoxview_general_telemetry.js"]
44+
fail-if = ["a11y_checks"] # Bug 1854625 clicked .fxview-tab-row-secondary-button may not be focusable
45+
46+
["browser_firefoxview_navigation.js"]
47+
48+
["browser_firefoxview_virtual_list.js"]
49+
50+
["browser_history_firefoxview.js"]
51+
52+
["browser_opentabs_firefoxview.js"]
53+
fail-if = ["a11y_checks"] # Bugs 1854625 and 1872285 clicked .fxview-tab-row-secondary-button may not be focusable
54+
55+
["browser_opentabs_cards.js"]
56+
fail-if = ["a11y_checks"] # Bug 1858041 clicked .fxview-tab-row-main and div may not be focusable
57+
58+
["browser_opentabs_recency.js"]
59+
skip-if = [
60+
"os == 'win'",
61+
"os == 'mac' && verify"
62+
] # macos times out, see bug 1857293, skipped for windows, see bug 1858460
63+
64+
65+
["browser_recentlyclosed_firefoxview.js"]
66+
fail-if = ["a11y_checks"] # Bug 1854625 clicked button.fxview-tab-row-secondary-button and a.fxview-tab-row-main may not be focusable
67+
68+
["browser_syncedtabs_errors_firefoxview.js"]
69+
70+
["browser_syncedtabs_firefoxview.js"]

browser/components/firefoxview/tests/browser/browser_firefoxview.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,75 @@ add_task(async function about_firefoxview_smoke_test() {
1313
ok(document.querySelector("named-deck"), "named-deck element exists");
1414
});
1515
});
16+
17+
add_task(async function test_aria_roles() {
18+
await withFirefoxView({}, async browser => {
19+
const { document } = browser.contentWindow;
20+
is(document.location.href, "about:firefoxview");
21+
22+
is(
23+
document.querySelector("main").getAttribute("role"),
24+
"application",
25+
"The main element has role='application'"
26+
);
27+
// Purge session history to ensure recently closed empty state is shown
28+
Services.obs.notifyObservers(null, "browser:purge-session-history");
29+
let recentlyClosedComponent = document.querySelector(
30+
"view-recentlyclosed[slot=recentlyclosed]"
31+
);
32+
await TestUtils.waitForCondition(
33+
() => recentlyClosedComponent.fullyUpdated
34+
);
35+
let recentlyClosedEmptyState = recentlyClosedComponent.emptyState;
36+
let descriptionEls = recentlyClosedEmptyState.descriptionEls;
37+
is(
38+
descriptionEls[1].querySelector("a").getAttribute("aria-details"),
39+
"card-container",
40+
"The link within the recently closed empty state has the expected 'aria-details' attribute."
41+
);
42+
43+
let syncedTabsComponent = document.querySelector(
44+
"view-syncedtabs[slot=syncedtabs]"
45+
);
46+
let syncedTabsEmptyState = syncedTabsComponent.emptyState;
47+
is(
48+
syncedTabsEmptyState.querySelector("button").getAttribute("aria-details"),
49+
"empty-container",
50+
"The button within the synced tabs empty state has the expected 'aria-details' attribute."
51+
);
52+
53+
// Test keyboard navigation from card-container summary
54+
// elements to links/buttons in empty states
55+
const tab = async shiftKey => {
56+
info(`Tab${shiftKey ? " + Shift" : ""}`);
57+
EventUtils.synthesizeKey("KEY_Tab", { shiftKey });
58+
};
59+
recentlyClosedComponent.cardEl.summaryEl.focus();
60+
ok(
61+
recentlyClosedComponent.cardEl.summaryEl.matches(":focus"),
62+
"Focus should be on the summary element within the recently closed card-container"
63+
);
64+
// Purge session history to ensure recently closed empty state is shown
65+
Services.obs.notifyObservers(null, "browser:purge-session-history");
66+
await TestUtils.waitForCondition(
67+
() => recentlyClosedComponent.fullyUpdated
68+
);
69+
await tab();
70+
ok(
71+
descriptionEls[1].querySelector("a").matches(":focus"),
72+
"Focus should be on the link within the recently closed empty state"
73+
);
74+
await tab();
75+
const shadowRoot =
76+
SpecialPowers.wrap(syncedTabsComponent).openOrClosedShadowRoot;
77+
ok(
78+
shadowRoot.querySelector("card-container").summaryEl.matches(":focus"),
79+
"Focus should be on summary element of the synced tabs card-container"
80+
);
81+
await tab();
82+
ok(
83+
syncedTabsEmptyState.querySelector("button").matches(":focus"),
84+
"Focus should be on button element of the synced tabs empty state"
85+
);
86+
});
87+
});
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const CARD_COLLAPSED_EVENT = [
75
["firefoxview_next", "card_collapsed", "card_container", undefined],
86
];
@@ -301,6 +299,7 @@ add_task(async function test_context_menu_private_window_telemetry() {
301299
});
302300

303301
add_task(async function test_context_menu_delete_from_history_telemetry() {
302+
await PlacesUtils.history.clear();
304303
await PlacesUtils.history.insert({
305304
url: URLs[0],
306305
title: "Example Domain 1",
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const URL_BASE = `${getFirefoxViewURL()}#`;
75

86
function assertCorrectPage(document, name, event) {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const tabURL1 = "data:,Tab1";
75
const tabURL2 = "data:,Tab2";
86
const tabURL3 = "data:,Tab3";
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const VIRTUAL_LIST_ENABLED_PREF = "browser.firefox-view.virtual-list.enabled";
75

86
add_setup(async () => {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
ChromeUtils.defineESModuleGetters(globalThis, {
75
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
86
});
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const TEST_URL = "about:robots";
75
const ROW_URL_ID = "fxview-tab-row-url";
86
const ROW_DATE_ID = "fxview-tab-row-date";
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const TEST_URL1 = "about:robots";
75
const TEST_URL2 = "https://example.org/";
86
const TEST_URL3 = "about:mozilla";
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
/*
75
This test checks the recent-browsing view of open tabs in about:firefoxview next
86
presents the correct tab data in the correct order.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
requestLongerTimeout(2);
75

86
ChromeUtils.defineESModuleGetters(globalThis, {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
const { LoginTestUtils } = ChromeUtils.importESModule(
75
"resource://testing-common/LoginTestUtils.sys.mjs"
86
);
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* Any copyright is dedicated to the Public Domain.
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

4-
/* import-globals-from ../head.js */
5-
64
add_setup(async function () {
75
registerCleanupFunction(() => {
86
// reset internal state so it doesn't affect the next tests
@@ -684,6 +682,7 @@ add_task(async function search_synced_tabs_recent_browsing() {
684682
),
685683
"Synced Tabs component is done updating."
686684
);
685+
slot.tabLists[0].scrollIntoView();
687686
await TestUtils.waitForCondition(
688687
() => slot.tabLists[0]?.rowEls.length === 5,
689688
"Not all search results are shown yet."

browser/components/firefoxview/tests/browser/firefoxview-next/browser.toml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)