diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /toolkit/components/reader/test/browser_drag_url_readerMode.js | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/reader/test/browser_drag_url_readerMode.js')
-rw-r--r-- | toolkit/components/reader/test/browser_drag_url_readerMode.js | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/toolkit/components/reader/test/browser_drag_url_readerMode.js b/toolkit/components/reader/test/browser_drag_url_readerMode.js deleted file mode 100644 index 2dae1872c3..0000000000 --- a/toolkit/components/reader/test/browser_drag_url_readerMode.js +++ /dev/null @@ -1,61 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -const TEST_PATH = getRootDirectory(gTestPath).replace( - "chrome://mochitests/content", - "http://example.com" -); - -add_task(async function test_readerModeURLDrag() { - await BrowserTestUtils.withNewTab( - { - gBrowser, - url: TEST_PATH + "readerModeArticle.html", - }, - - async browser => { - let readerButton = document.getElementById("reader-mode-button"); - await TestUtils.waitForCondition( - () => !readerButton.hidden, - "Reader mode button should become visible" - ); - - is_element_visible( - readerButton, - "Reader mode button is present on a reader-able page" - ); - - // Switch page into reader mode. - let promiseTabLoad = BrowserTestUtils.browserLoaded(browser); - readerButton.click(); - await promiseTabLoad; - let urlbar = document.getElementById("urlbar-input"); - let readerUrl = gBrowser.selectedBrowser.currentURI.spec; - ok( - readerUrl.startsWith("about:reader"), - "about:reader loaded after clicking reader mode button" - ); - - let dataTran = new DataTransfer(); - let urlEvent = new DragEvent("dragstart", { dataTransfer: dataTran }); - let oldUrl = TEST_PATH + "readerModeArticle.html"; - let urlBarContainer = document.getElementById("urlbar-input-container"); - // We intentionally turn off a11y_checks for the following click, because - // it is send to prepare the URL Bar for the mouse-specific action - for a - // drag event, while there are other ways are accessible for users of - // assistive technology and keyboards, therefore this test can be excluded - // from the accessibility tests. - AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); - urlBarContainer.click(); - AccessibilityUtils.resetEnv(); - urlbar.dispatchEvent(urlEvent); - - let newUrl = urlEvent.dataTransfer.getData("text/plain"); - ok(!newUrl.includes("about:reader"), "URL does not contain about:reader"); - - Assert.equal(newUrl, oldUrl, "URL is the same"); - } - ); -}); |