mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 1367621 - Regression test to ensure that the URL bar is focused when new tabs are opened in fullscreen mode. r=Felipe
MozReview-Commit-ID: 66Rl2U2Kdbl --HG-- extra : rebase_source : 04c00eaa006db0b7369de3a9f3989e0e44d9145c
This commit is contained in:
parent
f34697f42a
commit
e4124cb8f6
@ -28,6 +28,7 @@ skip-if = (os == "mac" && debug) # temporary skip-if due to increase in intermit
|
||||
subsuite = clipboard
|
||||
[browser_newtab_drop_preview.js]
|
||||
[browser_newtab_focus.js]
|
||||
[browser_newtab_fullscreen_focus.js]
|
||||
[browser_newtab_perwindow_private_browsing.js]
|
||||
[browser_newtab_reflow_load.js]
|
||||
support-files =
|
||||
|
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
function isFullscreenSizeMode() {
|
||||
let sizemode = document.documentElement.getAttribute("sizemode");
|
||||
return sizemode == "fullscreen";
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the URL bar is correctly focused
|
||||
* when a new tab is opened while in fullscreen
|
||||
* mode.
|
||||
*/
|
||||
add_task(async function() {
|
||||
gURLBar.blur();
|
||||
|
||||
Assert.ok(!window.fullScreen, "Should not start in fullscreen mode.");
|
||||
BrowserFullScreen();
|
||||
await BrowserTestUtils.waitForCondition(() => isFullscreenSizeMode());
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
// Exit fullscreen if we're still in it.
|
||||
if (window.fullScreen) {
|
||||
BrowserFullScreen();
|
||||
await BrowserTestUtils.waitForCondition(() => !isFullscreenSizeMode());
|
||||
}
|
||||
});
|
||||
|
||||
Assert.ok(window.fullScreen, "Should be in fullscreen mode now.");
|
||||
|
||||
let newTabOpened = BrowserTestUtils.waitForEvent(gBrowser, "TabSwitchDone");
|
||||
BrowserOpenTab();
|
||||
await newTabOpened;
|
||||
|
||||
Assert.ok(gURLBar.focused, "URL bar should be focused.");
|
||||
});
|
Loading…
Reference in New Issue
Block a user