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:
Mike Conley 2017-05-26 12:21:25 -04:00
parent f34697f42a
commit e4124cb8f6
2 changed files with 36 additions and 0 deletions

View File

@ -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 =

View File

@ -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.");
});