2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-11-07 22:38:24 -08:00
|
|
|
|
|
|
|
// ----------
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
// verify initial state
|
|
|
|
ok(!TabView.isVisible(), "Tab View starts hidden");
|
|
|
|
|
2011-04-13 13:14:42 -07:00
|
|
|
showTabView(onTabViewLoadedAndShown("ltr"));
|
2010-11-07 22:38:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ----------
|
|
|
|
function onTabViewLoadedAndShown(dir) {
|
|
|
|
return function() {
|
|
|
|
ok(TabView.isVisible(), "Tab View is visible.");
|
|
|
|
|
|
|
|
let contentWindow = document.getElementById("tab-view").contentWindow;
|
|
|
|
let contentDocument = contentWindow.document;
|
|
|
|
is(contentDocument.documentElement.getAttribute("dir"), dir,
|
|
|
|
"The direction should be set to " + dir.toUpperCase());
|
|
|
|
|
|
|
|
// kick off the series
|
2011-04-13 13:14:42 -07:00
|
|
|
hideTabView(onTabViewHidden(dir));
|
2010-11-07 22:38:24 -08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------
|
|
|
|
function onTabViewHidden(dir) {
|
|
|
|
return function() {
|
|
|
|
ok(!TabView.isVisible(), "Tab View is hidden.");
|
|
|
|
|
|
|
|
if (dir == "ltr") {
|
|
|
|
// Switch to RTL mode
|
|
|
|
Services.prefs.setCharPref("intl.uidirection.en-US", "rtl");
|
|
|
|
|
2011-04-13 13:14:42 -07:00
|
|
|
showTabView(onTabViewLoadedAndShown("rtl"));
|
2010-11-07 22:38:24 -08:00
|
|
|
} else {
|
|
|
|
// Switch to LTR mode
|
|
|
|
Services.prefs.clearUserPref("intl.uidirection.en-US");
|
|
|
|
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|