mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1745208 - [utilityOverlay] Add new tests for openWebLinkIn r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D134184
This commit is contained in:
parent
e9435cc2da
commit
bdb6783a8a
@ -106,6 +106,9 @@ with Files("test/tabs/**"):
|
||||
with Files("test/touch/**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/utilityOverlay/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("test/protectionsUI/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Protections UI")
|
||||
|
||||
|
5
browser/base/content/test/utilityOverlay/.eslintrc.js
Normal file
5
browser/base/content/test/utilityOverlay/.eslintrc.js
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
2
browser/base/content/test/utilityOverlay/browser.ini
Normal file
2
browser/base/content/test/utilityOverlay/browser.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[DEFAULT]
|
||||
[browser_openWebLinkIn.js]
|
@ -0,0 +1,55 @@
|
||||
/* 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 EXAMPLE_URL = "https://example.org/";
|
||||
add_task(async function test_open_tab() {
|
||||
const waitForTabPromise = BrowserTestUtils.waitForNewTab(
|
||||
gBrowser,
|
||||
EXAMPLE_URL
|
||||
);
|
||||
openWebLinkIn(EXAMPLE_URL, "tab");
|
||||
|
||||
const tab = await waitForTabPromise;
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
add_task(async function test_open_window() {
|
||||
const waitForWindowPromise = BrowserTestUtils.waitForNewWindow();
|
||||
openWebLinkIn(EXAMPLE_URL, "window");
|
||||
|
||||
const win = await waitForWindowPromise;
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
});
|
||||
|
||||
add_task(async function test_open_private_window() {
|
||||
const waitForWindowPromise = BrowserTestUtils.waitForNewWindow();
|
||||
openWebLinkIn(EXAMPLE_URL, "window", {
|
||||
private: true,
|
||||
});
|
||||
const win = await waitForWindowPromise;
|
||||
ok(
|
||||
PrivateBrowsingUtils.isBrowserPrivate(win),
|
||||
"The new window is a private window."
|
||||
);
|
||||
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
});
|
||||
|
||||
add_task(async function test_open_private_tab_from_private_window() {
|
||||
const privateWindow = await BrowserTestUtils.openNewBrowserWindow({
|
||||
private: true,
|
||||
});
|
||||
const waitForTabPromise = BrowserTestUtils.waitForNewTab(
|
||||
privateWindow.gBrowser,
|
||||
EXAMPLE_URL
|
||||
);
|
||||
privateWindow.openWebLinkIn(EXAMPLE_URL, "tab");
|
||||
const tab = await waitForTabPromise;
|
||||
ok(
|
||||
PrivateBrowsingUtils.isBrowserPrivate(tab),
|
||||
"The new tab was opened in a private browser."
|
||||
);
|
||||
await BrowserTestUtils.closeWindow(privateWindow);
|
||||
});
|
@ -61,6 +61,7 @@ BROWSER_CHROME_MANIFESTS += [
|
||||
"content/test/tabPrompts/browser.ini",
|
||||
"content/test/tabs/browser.ini",
|
||||
"content/test/touch/browser.ini",
|
||||
"content/test/utilityOverlay/browser.ini",
|
||||
"content/test/webextensions/browser.ini",
|
||||
"content/test/webrtc/browser.ini",
|
||||
"content/test/webrtc/gracePeriod/browser.ini",
|
||||
|
Loading…
Reference in New Issue
Block a user