mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 645725 - Fix for mobile browser-chrome tests [r=mfinkle DONTBUILD]
This commit is contained in:
parent
a4f1cf3368
commit
1e3d0b45ed
@ -162,7 +162,7 @@ gTests.push({
|
||||
is(Elements.urlbarState.getAttribute("mode"), "edit", "bcast_urlbarState mode attribute should be equal to 'edit'");
|
||||
|
||||
let edit = BrowserUI._edit;
|
||||
is(edit.readOnly, !Util.isPortrait(), "urlbar input textbox be readonly once it is open in landscape, editable if portrait");
|
||||
is(edit.readOnly, BrowserUI._isKeyboardFullscreen(), "urlbar input textbox is readonly if keyboard is fullscreen, editable otherwise");
|
||||
|
||||
let urlString = BrowserUI.getDisplayURI(Browser.selectedBrowser);
|
||||
if (Util.isURLEmpty(urlString))
|
||||
@ -174,7 +174,7 @@ gTests.push({
|
||||
is(BrowserUI.activePanel, aPanel, "The panel " + aPanel.panel.id + " should be selected");
|
||||
if (firstPanel) {
|
||||
// First panel will have selected text, if we are in portrait
|
||||
is(edit.readOnly, !Util.isPortrait(), "urlbar input textbox be readonly once it is open in landscape, editable if portrait");
|
||||
is(edit.readOnly, BrowserUI._isKeyboardFullscreen(), "urlbar input textbox is readonly if keyboard is fullscreen, editable otherwise");
|
||||
} else {
|
||||
is(edit.readOnly, true, "urlbar input textbox be readonly if not the first panel");
|
||||
}
|
||||
@ -223,7 +223,7 @@ gTests.push({
|
||||
let firstPanel = true;
|
||||
Panels.forEach(function(aPanel) {
|
||||
aPanel.doCommand();
|
||||
if (firstPanel && Util.isPortrait()) {
|
||||
if (firstPanel && !BrowserUI._isKeyboardFullscreen()) {
|
||||
// First panel will have selected text, if we are in portrait
|
||||
ok(edit.selectionStart == 0 && edit.selectionEnd == edit.textLength, "[case 1] urlbar text should be selected on a simple show");
|
||||
edit.click();
|
||||
@ -246,7 +246,7 @@ gTests.push({
|
||||
firstPanel = true;
|
||||
Panels.forEach(function(aPanel) {
|
||||
aPanel.doCommand();
|
||||
if (firstPanel && Util.isPortrait()) {
|
||||
if (firstPanel && !BrowserUI._isKeyboardFullscreen()) {
|
||||
// First panel will have selected text, if we are in portrait
|
||||
ok(edit.selectionStart == 0 && edit.selectionEnd == edit.textLength, "[case 1] urlbar text should be selected on a simple show");
|
||||
edit.click();
|
||||
@ -282,11 +282,12 @@ gTests.push({
|
||||
edit.clickSelectsAll = oldClickSelectsAll;
|
||||
|
||||
BrowserUI.activePanel = null;
|
||||
Browser.closeTab(gCurrentTest.currentTab, { forceClose: true });
|
||||
|
||||
// Ensure the tab is well closed before doing the rest of the code, otherwise
|
||||
// this cause some bugs with the composition events
|
||||
waitFor(runNextTest, function() { return Browser.tabs.length == 1 });
|
||||
let tabCount = Browser.tabs.length;
|
||||
Browser.closeTab(gCurrentTest.currentTab, { forceClose: true });
|
||||
waitFor(runNextTest, function() Browser.tabs.length == tabCount - 1);
|
||||
}
|
||||
});
|
||||
|
||||
@ -378,7 +379,7 @@ gTests.push({
|
||||
|
||||
window.addEventListener("popupshown", function() {
|
||||
window.removeEventListener("popupshown", arguments.callee, false);
|
||||
if (!Util.isPortrait())
|
||||
if (BrowserUI._isKeyboardFullscreen())
|
||||
gCurrentTest.inputField.readOnly = false;
|
||||
setTimeout(gCurrentTest.onPopupReady, 0);
|
||||
}, false);
|
||||
@ -422,10 +423,14 @@ gTests.push({
|
||||
// XXX this sucks because it means we'll be stuck 500ms if the test succeed
|
||||
// but I don't have a better idea about how to do it for now since we don't
|
||||
// that to happen!
|
||||
|
||||
/* TODO: This is currently failing (bug 642771)
|
||||
waitForAndContinue(function() {
|
||||
gCurrentTest._checkState();
|
||||
runNextTest();
|
||||
}, isHiddenHeader, Date.now() + 500);
|
||||
*/
|
||||
runNextTest();
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user