summaryrefslogtreecommitdiffstats
path: root/toolkit/components/reader/test/browser_readerMode_remoteType.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /toolkit/components/reader/test/browser_readerMode_remoteType.js
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/reader/test/browser_readerMode_remoteType.js')
-rw-r--r--toolkit/components/reader/test/browser_readerMode_remoteType.js87
1 files changed, 0 insertions, 87 deletions
diff --git a/toolkit/components/reader/test/browser_readerMode_remoteType.js b/toolkit/components/reader/test/browser_readerMode_remoteType.js
deleted file mode 100644
index c2510667c8..0000000000
--- a/toolkit/components/reader/test/browser_readerMode_remoteType.js
+++ /dev/null
@@ -1,87 +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/. */
-
-"use strict";
-
-const TEST_PATH = getRootDirectory(gTestPath).replace(
- "chrome://mochitests/content",
- "http://example.com"
-);
-
-const CROSS_SITE_TEST_PATH = getRootDirectory(gTestPath).replace(
- "chrome://mochitests/content",
- "http://example.org"
-);
-
-/**
- * Test that switching an article into readermode doesn't change its' remoteType.
- * Test that the reader mode correctly calculates and displays the
- * estimated reading time for a short article
- */
-add_task(async function () {
- info("opening readermode normally to ensure process doesn't change");
- let articleRemoteType;
- let aboutReaderURL;
- await BrowserTestUtils.withNewTab(
- TEST_PATH + "readerModeArticleShort.html",
- async function (browser) {
- articleRemoteType = browser.remoteType;
-
- // Click on the readermode button to switch into reader mode, and get the
- // URL for that reader mode.
- let pageShownPromise = BrowserTestUtils.waitForContentEvent(
- browser,
- "AboutReaderContentReady"
- );
- let readerButton = document.getElementById("reader-mode-button");
- readerButton.click();
- await pageShownPromise;
-
- aboutReaderURL = browser.documentURI.spec;
- ok(
- aboutReaderURL.startsWith("about:reader"),
- "about:reader should have been opened"
- );
- is(
- browser.remoteType,
- articleRemoteType,
- "remote type should not have changed"
- );
- }
- );
-
- info(
- "opening new tab directly with about reader URL into correct remote type"
- );
- await BrowserTestUtils.withNewTab(aboutReaderURL, async function (browser) {
- is(
- browser.remoteType,
- articleRemoteType,
- "Should have performed about:reader load in the correct remote type"
- );
- });
-
- info("navigating process into correct remote type");
- await BrowserTestUtils.withNewTab(
- CROSS_SITE_TEST_PATH + "readerModeArticleShort.html",
- async function (browser) {
- if (SpecialPowers.useRemoteSubframes) {
- isnot(
- browser.remoteType,
- articleRemoteType,
- "Cross-site article should have different remote type with fission"
- );
- }
-
- BrowserTestUtils.startLoadingURIString(browser, aboutReaderURL);
- await BrowserTestUtils.browserLoaded(browser);
-
- is(
- browser.remoteType,
- articleRemoteType,
- "Should have switched into the correct remote type"
- );
- }
- );
-});