2011-02-28 01:36:36 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-11-08 06:38:24 +00:00
|
|
|
|
|
|
|
// ----------
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
// verify initial state
|
|
|
|
ok(!TabView.isVisible(), "Tab View starts hidden");
|
|
|
|
|
2011-04-13 20:14:42 +00:00
|
|
|
showTabView(onTabViewLoadedAndShown("ltr"));
|
2010-11-08 06:38:24 +00: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 20:14:42 +00:00
|
|
|
hideTabView(onTabViewHidden(dir));
|
2010-11-08 06:38:24 +00: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 20:14:42 +00:00
|
|
|
showTabView(onTabViewLoadedAndShown("rtl"));
|
2010-11-08 06:38:24 +00:00
|
|
|
} else {
|
|
|
|
// Switch to LTR mode
|
|
|
|
Services.prefs.clearUserPref("intl.uidirection.en-US");
|
|
|
|
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|