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