Bug 965832 - Tests. r=mbrubeck

This commit is contained in:
Jim Mathies 2014-01-31 12:10:17 -06:00
Родитель b6249d4347
Коммит 49f455ac33
3 изменённых файлов: 96 добавлений и 0 удалений

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

@ -0,0 +1,44 @@
// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
gTests.push({
desc: "about flyout hides navbar, clears navbar selection, doesn't leak",
run: function() {
yield showNavBar();
let edit = document.getElementById("urlbar-edit");
edit.value = "http://www.wikipedia.org/";
sendElementTap(window, edit);
yield waitForCondition(function () {
return SelectionHelperUI.isSelectionUIVisible;
});
ok(ContextUI.navbarVisible, "nav bar visible");
let promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend");
FlyoutPanelsUI.show('AboutFlyoutPanel');
yield promise;
yield waitForCondition(function () {
return !SelectionHelperUI.isSelectionUIVisible;
});
ok(!ContextUI.navbarVisible, "nav bar hidden");
promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend");
FlyoutPanelsUI.hide('AboutFlyoutPanel');
yield promise;
}
});
function test() {
if (!isLandscapeMode()) {
todo(false, "browser_selection_tests need landscape mode to run.");
return;
}
runTests();
}

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

@ -174,9 +174,60 @@ gTests.push({
let promise = waitForCondition(condition);
sendElementTap(window, copy);
ok((yield promise), "copy text onto clipboard")
clearSelection(edit);
edit.blur();
}
})
gTests.push({
desc: "bug 965832 - selection monocles move with the nav bar",
run: function() {
yield showNavBar();
let originalUtils = Services.metro;
Services.metro = {
keyboardHeight: 0,
keyboardVisible: false
};
registerCleanupFunction(function() {
Services.metro = originalUtils;
});
let edit = document.getElementById("urlbar-edit");
edit.value = "http://www.wikipedia.org/";
sendElementTap(window, edit);
let promise = waitForEvent(window, "MozDeckOffsetChanged");
Services.metro.keyboardHeight = 300;
Services.metro.keyboardVisible = true;
Services.obs.notifyObservers(null, "metro_softkeyboard_shown", null);
yield promise;
yield waitForCondition(function () {
return SelectionHelperUI.isSelectionUIVisible;
});
promise = waitForEvent(window, "MozDeckOffsetChanged");
Services.metro.keyboardHeight = 0;
Services.metro.keyboardVisible = false;
Services.obs.notifyObservers(null, "metro_softkeyboard_hidden", null);
yield promise;
yield waitForCondition(function () {
return SelectionHelperUI.isSelectionUIVisible;
});
clearSelection(edit);
edit.blur();
yield waitForCondition(function () {
return !SelectionHelperUI.isSelectionUIVisible;
});
}
});
function test() {
if (!isLandscapeMode()) {
todo(false, "browser_selection_tests need landscape mode to run.");

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

@ -37,6 +37,7 @@ support-files =
res/documentindesignmode.html
[browser_apzc_basic.js]
[browser_flyouts.js]
[browser_bookmarks.js]
[browser_canonizeURL.js]
[browser_circular_progress_indicator.js]