mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Bug 649127 - Intermittent timeout in browser/base/content/test/tabview/browser_tabview_rtl.js | application timed out after 330 seconds with no output [f=raymond, r=ehsan]
This commit is contained in:
parent
c0345fe392
commit
6251df87e5
@ -1,8 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let tabViewShownCount = 0;
|
||||
|
||||
// ----------
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
@ -10,20 +8,12 @@ function test() {
|
||||
// verify initial state
|
||||
ok(!TabView.isVisible(), "Tab View starts hidden");
|
||||
|
||||
// use the Tab View button to launch it for the first time
|
||||
window.addEventListener("tabviewshown", onTabViewLoadedAndShown("ltr"), false);
|
||||
toggleTabView();
|
||||
}
|
||||
|
||||
function toggleTabView() {
|
||||
let tabViewCommand = document.getElementById("Browser:ToggleTabView");
|
||||
tabViewCommand.doCommand();
|
||||
showTabView(onTabViewLoadedAndShown("ltr"));
|
||||
}
|
||||
|
||||
// ----------
|
||||
function onTabViewLoadedAndShown(dir) {
|
||||
return function() {
|
||||
window.removeEventListener("tabviewshown", arguments.callee, false);
|
||||
ok(TabView.isVisible(), "Tab View is visible.");
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
@ -32,24 +22,20 @@ function onTabViewLoadedAndShown(dir) {
|
||||
"The direction should be set to " + dir.toUpperCase());
|
||||
|
||||
// kick off the series
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden(dir), false);
|
||||
TabView.toggle();
|
||||
hideTabView(onTabViewHidden(dir));
|
||||
};
|
||||
}
|
||||
|
||||
// ----------
|
||||
function onTabViewHidden(dir) {
|
||||
return function() {
|
||||
window.removeEventListener("tabviewhidden", arguments.callee, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden.");
|
||||
|
||||
if (dir == "ltr") {
|
||||
// Switch to RTL mode
|
||||
Services.prefs.setCharPref("intl.uidirection.en-US", "rtl");
|
||||
|
||||
// use the Tab View button to launch it for the second time
|
||||
window.addEventListener("tabviewshown", onTabViewLoadedAndShown("rtl"), false);
|
||||
toggleTabView();
|
||||
showTabView(onTabViewLoadedAndShown("rtl"));
|
||||
} else {
|
||||
// Switch to LTR mode
|
||||
Services.prefs.clearUserPref("intl.uidirection.en-US");
|
||||
@ -58,4 +44,3 @@ function onTabViewHidden(dir) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user