зеркало из https://github.com/mozilla/gecko-dev.git
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 Differential Revision: https://phabricator.services.mozilla.com/D196347
This commit is contained in:
Родитель
2e7027b7a9
Коммит
ea95272239
|
@ -74,8 +74,7 @@ static const RedirEntry kRedirMap[] = {
|
|||
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
|
||||
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
||||
nsIAboutModule::IS_SECURE_CHROME_UI},
|
||||
{"firefoxview",
|
||||
"chrome://browser/content/firefoxview/firefoxview-next.html",
|
||||
{"firefoxview", "chrome://browser/content/firefoxview/firefoxview.html",
|
||||
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
|
||||
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
|
||||
{"policies", "chrome://browser/content/policies/aboutPolicies.html",
|
||||
|
|
|
@ -14,7 +14,6 @@ pages = [
|
|||
'logins',
|
||||
'loginsimportreport',
|
||||
'firefoxview',
|
||||
'firefoxview-next',
|
||||
'messagepreview',
|
||||
'newtab',
|
||||
'ion',
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<link rel="localization" href="browser/migrationWizard.ftl" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
<script
|
||||
type="module"
|
||||
|
@ -113,6 +113,6 @@
|
|||
</named-deck>
|
||||
</div>
|
||||
</main>
|
||||
<script src="chrome://browser/content/firefoxview/firefoxview-next.mjs"></script>
|
||||
<script src="chrome://browser/content/firefoxview/firefoxview.mjs"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -534,7 +534,7 @@ class HistoryInView extends ViewPage {
|
|||
return html`
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
browser.jar:
|
||||
content/browser/firefoxview/card-container.css
|
||||
content/browser/firefoxview/card-container.mjs
|
||||
content/browser/firefoxview/firefoxview-next.html
|
||||
content/browser/firefoxview/firefoxview-next.mjs
|
||||
content/browser/firefoxview/firefoxview.html
|
||||
content/browser/firefoxview/firefoxview.mjs
|
||||
content/browser/firefoxview/history.css
|
||||
content/browser/firefoxview/history.mjs
|
||||
content/browser/firefoxview/opentabs.mjs
|
||||
|
@ -14,7 +14,7 @@ browser.jar:
|
|||
content/browser/firefoxview/syncedtabs.mjs
|
||||
content/browser/firefoxview/view-syncedtabs.css
|
||||
content/browser/firefoxview/recentbrowsing.mjs
|
||||
content/browser/firefoxview/firefoxview-next.css
|
||||
content/browser/firefoxview/firefoxview.css
|
||||
content/browser/firefoxview/fxview-category-button.css
|
||||
content/browser/firefoxview/fxview-category-navigation.css
|
||||
content/browser/firefoxview/fxview-category-navigation.mjs
|
||||
|
|
|
@ -17,9 +17,6 @@ TESTING_JS_MODULES += [
|
|||
"tests/browser/FirefoxViewTestUtils.sys.mjs",
|
||||
]
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
"tests/browser/browser.toml",
|
||||
"tests/browser/firefoxview-next/browser.toml",
|
||||
]
|
||||
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
|
||||
|
||||
MOCHITEST_CHROME_MANIFESTS += ["tests/chrome/chrome.toml"]
|
||||
|
|
|
@ -205,7 +205,7 @@ class OpenTabsInView extends ViewPage {
|
|||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
<div class="sticky-container bottom-fade">
|
||||
<h2
|
||||
|
@ -498,7 +498,7 @@ class OpenTabsInViewCard extends ViewPageContent {
|
|||
return html`
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
<card-container
|
||||
?preserveCollapseState=${this.recentBrowsing}
|
||||
|
|
|
@ -40,7 +40,7 @@ class RecentBrowsingInView extends ViewPage {
|
|||
return html`
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
<div class="sticky-container bottom-fade">
|
||||
<h2
|
||||
|
|
|
@ -329,7 +329,7 @@ class RecentlyClosedTabsInView extends ViewPage {
|
|||
return html`
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>
|
||||
${when(
|
||||
!this.recentBrowsing,
|
||||
|
|
|
@ -549,7 +549,7 @@ class SyncedTabsInView extends ViewPage {
|
|||
/>`);
|
||||
renderArray.push(html` <link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview-next.css"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>`);
|
||||
|
||||
if (!this.recentBrowsing) {
|
||||
|
|
|
@ -37,3 +37,34 @@ skip-if = ["true"] # Bug 1851453
|
|||
["browser_tab_close_last_tab.js"]
|
||||
|
||||
["browser_tab_on_close_warning.js"]
|
||||
|
||||
["browser_firefoxview_paused.js"]
|
||||
|
||||
["browser_firefoxview_general_telemetry.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1854625 clicked .fxview-tab-row-secondary-button may not be focusable
|
||||
|
||||
["browser_firefoxview_navigation.js"]
|
||||
|
||||
["browser_firefoxview_virtual_list.js"]
|
||||
|
||||
["browser_history_firefoxview.js"]
|
||||
|
||||
["browser_opentabs_firefoxview.js"]
|
||||
fail-if = ["a11y_checks"] # Bugs 1854625 and 1872285 clicked .fxview-tab-row-secondary-button may not be focusable
|
||||
|
||||
["browser_opentabs_cards.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1858041 clicked .fxview-tab-row-main and div may not be focusable
|
||||
|
||||
["browser_opentabs_recency.js"]
|
||||
skip-if = [
|
||||
"os == 'win'",
|
||||
"os == 'mac' && verify"
|
||||
] # macos times out, see bug 1857293, skipped for windows, see bug 1858460
|
||||
|
||||
|
||||
["browser_recentlyclosed_firefoxview.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1854625 clicked button.fxview-tab-row-secondary-button and a.fxview-tab-row-main may not be focusable
|
||||
|
||||
["browser_syncedtabs_errors_firefoxview.js"]
|
||||
|
||||
["browser_syncedtabs_firefoxview.js"]
|
||||
|
|
|
@ -13,3 +13,75 @@ add_task(async function about_firefoxview_smoke_test() {
|
|||
ok(document.querySelector("named-deck"), "named-deck element exists");
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_aria_roles() {
|
||||
await withFirefoxView({}, async browser => {
|
||||
const { document } = browser.contentWindow;
|
||||
is(document.location.href, "about:firefoxview");
|
||||
|
||||
is(
|
||||
document.querySelector("main").getAttribute("role"),
|
||||
"application",
|
||||
"The main element has role='application'"
|
||||
);
|
||||
// Purge session history to ensure recently closed empty state is shown
|
||||
Services.obs.notifyObservers(null, "browser:purge-session-history");
|
||||
let recentlyClosedComponent = document.querySelector(
|
||||
"view-recentlyclosed[slot=recentlyclosed]"
|
||||
);
|
||||
await TestUtils.waitForCondition(
|
||||
() => recentlyClosedComponent.fullyUpdated
|
||||
);
|
||||
let recentlyClosedEmptyState = recentlyClosedComponent.emptyState;
|
||||
let descriptionEls = recentlyClosedEmptyState.descriptionEls;
|
||||
is(
|
||||
descriptionEls[1].querySelector("a").getAttribute("aria-details"),
|
||||
"card-container",
|
||||
"The link within the recently closed empty state has the expected 'aria-details' attribute."
|
||||
);
|
||||
|
||||
let syncedTabsComponent = document.querySelector(
|
||||
"view-syncedtabs[slot=syncedtabs]"
|
||||
);
|
||||
let syncedTabsEmptyState = syncedTabsComponent.emptyState;
|
||||
is(
|
||||
syncedTabsEmptyState.querySelector("button").getAttribute("aria-details"),
|
||||
"empty-container",
|
||||
"The button within the synced tabs empty state has the expected 'aria-details' attribute."
|
||||
);
|
||||
|
||||
// Test keyboard navigation from card-container summary
|
||||
// elements to links/buttons in empty states
|
||||
const tab = async shiftKey => {
|
||||
info(`Tab${shiftKey ? " + Shift" : ""}`);
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey });
|
||||
};
|
||||
recentlyClosedComponent.cardEl.summaryEl.focus();
|
||||
ok(
|
||||
recentlyClosedComponent.cardEl.summaryEl.matches(":focus"),
|
||||
"Focus should be on the summary element within the recently closed card-container"
|
||||
);
|
||||
// Purge session history to ensure recently closed empty state is shown
|
||||
Services.obs.notifyObservers(null, "browser:purge-session-history");
|
||||
await TestUtils.waitForCondition(
|
||||
() => recentlyClosedComponent.fullyUpdated
|
||||
);
|
||||
await tab();
|
||||
ok(
|
||||
descriptionEls[1].querySelector("a").matches(":focus"),
|
||||
"Focus should be on the link within the recently closed empty state"
|
||||
);
|
||||
await tab();
|
||||
const shadowRoot =
|
||||
SpecialPowers.wrap(syncedTabsComponent).openOrClosedShadowRoot;
|
||||
ok(
|
||||
shadowRoot.querySelector("card-container").summaryEl.matches(":focus"),
|
||||
"Focus should be on summary element of the synced tabs card-container"
|
||||
);
|
||||
await tab();
|
||||
ok(
|
||||
syncedTabsEmptyState.querySelector("button").matches(":focus"),
|
||||
"Focus should be on button element of the synced tabs empty state"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const CARD_COLLAPSED_EVENT = [
|
||||
["firefoxview_next", "card_collapsed", "card_container", undefined],
|
||||
];
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const URL_BASE = `${getFirefoxViewURL()}#`;
|
||||
|
||||
function assertCorrectPage(document, name, event) {
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const tabURL1 = "data:,Tab1";
|
||||
const tabURL2 = "data:,Tab2";
|
||||
const tabURL3 = "data:,Tab3";
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
ChromeUtils.defineESModuleGetters(globalThis, {
|
||||
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
|
||||
});
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const TEST_URL = "about:robots";
|
||||
const ROW_URL_ID = "fxview-tab-row-url";
|
||||
const ROW_DATE_ID = "fxview-tab-row-date";
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const TEST_URL1 = "about:robots";
|
||||
const TEST_URL2 = "https://example.org/";
|
||||
const TEST_URL3 = "about:mozilla";
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
/*
|
||||
This test checks the recent-browsing view of open tabs in about:firefoxview next
|
||||
presents the correct tab data in the correct order.
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
requestLongerTimeout(2);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(globalThis, {
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
const { LoginTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/LoginTestUtils.sys.mjs"
|
||||
);
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
add_setup(async function () {
|
||||
registerCleanupFunction(() => {
|
||||
// reset internal state so it doesn't affect the next tests
|
|
@ -1,35 +0,0 @@
|
|||
[DEFAULT]
|
||||
support-files = [ "../head.js"]
|
||||
|
||||
["browser_firefoxview_next.js"]
|
||||
|
||||
["browser_firefoxview_paused.js"]
|
||||
|
||||
["browser_firefoxview_next_general_telemetry.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1854625 clicked .fxview-tab-row-secondary-button may not be focusable
|
||||
|
||||
["browser_firefoxview_next_navigation.js"]
|
||||
|
||||
["browser_firefoxview_virtual_list.js"]
|
||||
|
||||
["browser_history_firefoxview_next.js"]
|
||||
|
||||
["browser_opentabs_firefoxview_next.js"]
|
||||
fail-if = ["a11y_checks"] # Bugs 1854625 and 1872285 clicked .fxview-tab-row-secondary-button may not be focusable
|
||||
|
||||
["browser_opentabs_cards.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1858041 clicked .fxview-tab-row-main and div may not be focusable
|
||||
|
||||
["browser_opentabs_recency_next.js"]
|
||||
skip-if = [
|
||||
"os == 'win'",
|
||||
"os == 'mac' && verify"
|
||||
] # macos times out, see bug 1857293, skipped for windows, see bug 1858460
|
||||
|
||||
|
||||
["browser_recentlyclosed_firefoxview_next.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1854625 clicked button.fxview-tab-row-secondary-button and a.fxview-tab-row-main may not be focusable
|
||||
|
||||
["browser_syncedtabs_errors_firefoxview_next.js"]
|
||||
|
||||
["browser_syncedtabs_firefoxview_next.js"]
|
|
@ -1,76 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
add_task(async function test_aria_roles() {
|
||||
await withFirefoxView({}, async browser => {
|
||||
const { document } = browser.contentWindow;
|
||||
is(document.location.href, "about:firefoxview");
|
||||
|
||||
is(
|
||||
document.querySelector("main").getAttribute("role"),
|
||||
"application",
|
||||
"The main element has role='application'"
|
||||
);
|
||||
// Purge session history to ensure recently closed empty state is shown
|
||||
Services.obs.notifyObservers(null, "browser:purge-session-history");
|
||||
let recentlyClosedComponent = document.querySelector(
|
||||
"view-recentlyclosed[slot=recentlyclosed]"
|
||||
);
|
||||
await TestUtils.waitForCondition(
|
||||
() => recentlyClosedComponent.fullyUpdated
|
||||
);
|
||||
let recentlyClosedEmptyState = recentlyClosedComponent.emptyState;
|
||||
let descriptionEls = recentlyClosedEmptyState.descriptionEls;
|
||||
is(
|
||||
descriptionEls[1].querySelector("a").getAttribute("aria-details"),
|
||||
"card-container",
|
||||
"The link within the recently closed empty state has the expected 'aria-details' attribute."
|
||||
);
|
||||
|
||||
let syncedTabsComponent = document.querySelector(
|
||||
"view-syncedtabs[slot=syncedtabs]"
|
||||
);
|
||||
let syncedTabsEmptyState = syncedTabsComponent.emptyState;
|
||||
is(
|
||||
syncedTabsEmptyState.querySelector("button").getAttribute("aria-details"),
|
||||
"empty-container",
|
||||
"The button within the synced tabs empty state has the expected 'aria-details' attribute."
|
||||
);
|
||||
|
||||
// Test keyboard navigation from card-container summary
|
||||
// elements to links/buttons in empty states
|
||||
const tab = async shiftKey => {
|
||||
info(`Tab${shiftKey ? " + Shift" : ""}`);
|
||||
EventUtils.synthesizeKey("KEY_Tab", { shiftKey });
|
||||
};
|
||||
recentlyClosedComponent.cardEl.summaryEl.focus();
|
||||
ok(
|
||||
recentlyClosedComponent.cardEl.summaryEl.matches(":focus"),
|
||||
"Focus should be on the summary element within the recently closed card-container"
|
||||
);
|
||||
// Purge session history to ensure recently closed empty state is shown
|
||||
Services.obs.notifyObservers(null, "browser:purge-session-history");
|
||||
await TestUtils.waitForCondition(
|
||||
() => recentlyClosedComponent.fullyUpdated
|
||||
);
|
||||
await tab();
|
||||
ok(
|
||||
descriptionEls[1].querySelector("a").matches(":focus"),
|
||||
"Focus should be on the link within the recently closed empty state"
|
||||
);
|
||||
await tab();
|
||||
const shadowRoot =
|
||||
SpecialPowers.wrap(syncedTabsComponent).openOrClosedShadowRoot;
|
||||
ok(
|
||||
shadowRoot.querySelector("card-container").summaryEl.matches(":focus"),
|
||||
"Focus should be on summary element of the synced tabs card-container"
|
||||
);
|
||||
await tab();
|
||||
ok(
|
||||
syncedTabsEmptyState.querySelector("button").matches(":focus"),
|
||||
"Focus should be on button element of the synced tabs empty state"
|
||||
);
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче