зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1764318 - Add more test for fullscreen; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D143489
This commit is contained in:
Родитель
39c161dd67
Коммит
425420c6d5
|
@ -15,7 +15,9 @@ skip-if =
|
||||||
[browser_fullscreen_enterInUrlbar.js]
|
[browser_fullscreen_enterInUrlbar.js]
|
||||||
skip-if = (os == 'mac') || (os == 'linux') #Bug 1648649
|
skip-if = (os == 'mac') || (os == 'linux') #Bug 1648649
|
||||||
[browser_fullscreen_window_open.js]
|
[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]
|
[browser_fullscreen_window_focus.js]
|
||||||
skip-if =
|
skip-if =
|
||||||
os == 'mac' # Bug 1568570
|
os == 'mac' # Bug 1568570
|
||||||
|
|
|
@ -28,6 +28,26 @@ async function testWindowOpen(iframeID) {
|
||||||
BrowserTestUtils.removeTab(tab);
|
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() {
|
add_setup(async function() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [
|
||||||
|
@ -44,3 +64,8 @@ add_task(function test_parentWindowOpen() {
|
||||||
add_task(function test_iframeWindowOpen() {
|
add_task(function test_iframeWindowOpen() {
|
||||||
return testWindowOpen(IFRAME_ID);
|
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);
|
window.openedWindow = window.open('https://example.com' + window.location.pathname);
|
||||||
if (canReply) event.ports[0].postMessage('opened');
|
if (canReply) event.ports[0].postMessage('opened');
|
||||||
} else if(event.data === "openpopup") {
|
} 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');
|
if (canReply) event.ports[0].postMessage('popupopened');
|
||||||
} else if(event.data === "focus") {
|
} else if(event.data === "focus") {
|
||||||
window.openedWindow.focus();
|
window.openedWindow.focus();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче