Bug 1764318 - Add more test for fullscreen; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D143489
This commit is contained in:
Edgar Chen 2022-10-13 20:28:59 +00:00
Родитель 39c161dd67
Коммит 425420c6d5
3 изменённых файлов: 29 добавлений и 2 удалений

Просмотреть файл

@ -15,7 +15,9 @@ skip-if =
[browser_fullscreen_enterInUrlbar.js]
skip-if = (os == 'mac') || (os == 'linux') #Bug 1648649
[browser_fullscreen_window_open.js]
skip-if = debug && os == 'mac' # Bug 1568570
skip-if =
debug && os == 'mac' # Bug 1568570
swgl
[browser_fullscreen_window_focus.js]
skip-if =
os == 'mac' # Bug 1568570

Просмотреть файл

@ -28,6 +28,26 @@ async function testWindowOpen(iframeID) {
BrowserTestUtils.removeTab(tab);
}
async function testWindowOpenExistingWindow() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
let popup = await jsWindowOpen(tab.linkedBrowser, true);
info("re-focusing main window");
await waitForFocus(tab.linkedBrowser);
info("Entering full-screen");
await changeFullscreen(tab.linkedBrowser, true);
await testExpectFullScreenExit(tab.linkedBrowser, true, async () => {
info("Calling window.open() again should reuse the existing window");
jsWindowOpen(tab.linkedBrowser, true);
});
// Cleanup
await BrowserTestUtils.closeWindow(popup);
BrowserTestUtils.removeTab(tab);
}
add_setup(async function() {
await SpecialPowers.pushPrefEnv({
set: [
@ -44,3 +64,8 @@ add_task(function test_parentWindowOpen() {
add_task(function test_iframeWindowOpen() {
return testWindowOpen(IFRAME_ID);
});
add_task(function test_parentWindowOpenExistWindow() {
return testWindowOpenExistingWindow();
});

Просмотреть файл

@ -35,7 +35,7 @@
window.openedWindow = window.open('https://example.com' + window.location.pathname);
if (canReply) event.ports[0].postMessage('opened');
} else if(event.data === "openpopup") {
window.openedWindow = window.open('https://example.com' + window.location.pathname, '', 'top=0,height=1, width=300');
window.openedWindow = window.open('https://example.com' + window.location.pathname, 'test', 'top=0,height=1, width=300');
if (canReply) event.ports[0].postMessage('popupopened');
} else if(event.data === "focus") {
window.openedWindow.focus();