mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 967873 - Start TabView when starting tests that might lazily load it (r=Gijs)
This commit is contained in:
parent
0bb94168c1
commit
e135491cfd
@ -14,6 +14,13 @@ function testAttrib(elem, attrib, attribValue, msg) {
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
is(gBrowser.tabs.length, 1, "one tab is open initially");
|
||||
|
||||
// Add several new tabs in sequence, hiding some, to ensure that the
|
||||
|
@ -5,6 +5,12 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// establish initial state
|
||||
is(gBrowser.tabs.length, 1, "we start with one tab");
|
||||
|
||||
|
@ -7,6 +7,12 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// Add a tab that will get removed and hidden
|
||||
let testTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
is(gBrowser.visibleTabs.length, 2, "just added a tab, so 2 tabs");
|
||||
|
@ -2,7 +2,11 @@
|
||||
* 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/. */
|
||||
|
||||
function test() {
|
||||
add_task(function* () {
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
yield new Promise(resolve => TabView._initFrame(resolve));
|
||||
|
||||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
|
||||
@ -100,4 +104,5 @@ function test() {
|
||||
|
||||
if (tabViewWindow)
|
||||
tabViewWindow.GroupItems.groupItems[0].close();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5,6 +5,12 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
let tabOne = gBrowser.addTab("about:blank");
|
||||
let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
|
||||
gBrowser.selectedTab = tabTwo;
|
||||
|
@ -5,6 +5,12 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
is(gBrowser.visibleTabs.length, 1, "1 tab should be open");
|
||||
|
@ -2,7 +2,11 @@
|
||||
* 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/. */
|
||||
|
||||
function test() {
|
||||
add_task(function* test() {
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
yield new Promise(resolve => TabView._initFrame(resolve));
|
||||
|
||||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
is(gBrowser.visibleTabs.length, 1, "there is one visible tab");
|
||||
@ -51,4 +55,5 @@ function test() {
|
||||
|
||||
gBrowser.removeTab(testTab);
|
||||
gBrowser.removeTab(pinned);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2,7 +2,11 @@
|
||||
* 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/. */
|
||||
|
||||
function test() {
|
||||
add_task(function* test() {
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
yield new Promise(resolve => TabView._initFrame(resolve));
|
||||
|
||||
gPrefService.setBoolPref("browser.ctrlTab.previews", true);
|
||||
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
@ -30,7 +34,7 @@ function test() {
|
||||
|
||||
if (gPrefService.prefHasUserValue("browser.ctrlTab.previews"))
|
||||
gPrefService.clearUserPref("browser.ctrlTab.previews");
|
||||
}
|
||||
});
|
||||
|
||||
function pressCtrlTab(aShiftKey) {
|
||||
EventUtils.synthesizeKey("VK_TAB", { ctrlKey: true, shiftKey: !!aShiftKey });
|
||||
|
@ -6,6 +6,10 @@ add_task(function* () {
|
||||
/** Bug 607016 - If a tab is never restored, attributes (eg. hidden) aren't updated correctly **/
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
yield new Promise(resolve => TabView._initFrame(resolve));
|
||||
|
||||
// Set the pref to true so we know exactly how many tabs should be restoring at
|
||||
// any given time. This guarantees that a finishing load won't start another.
|
||||
Services.prefs.setBoolPref("browser.sessionstore.restore_on_demand", true);
|
||||
|
@ -7,6 +7,12 @@
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
// Ensure TabView has been initialized already. Otherwise it could
|
||||
// activate at an unexpected time and show/hide tabs.
|
||||
TabView._initFrame(runTest);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// We speed up the interval between session saves to ensure that the test
|
||||
// runs quickly.
|
||||
Services.prefs.setIntPref("browser.sessionstore.interval", 2000);
|
||||
|
Loading…
Reference in New Issue
Block a user