PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/toolkit/content/tests/chrome/test_bug649840.xul

http://github.com/zpao/v8monkey
Unknown | 66 lines | 52 code | 14 blank | 0 comment | 0 complexity | a36cf52732001ee1f2cee4c78900aa9b MD5 | raw file
 1<?xml version="1.0"?>
 2<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
 3<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
 4<!--
 5https://bugzilla.mozilla.org/show_bug.cgi?id=649840
 6-->
 7<window title="Mozilla Bug 649840" 
 8        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 9  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
10
11  <textbox id="textLTR" type="autocomplete" autocompletesearch="simple"/>
12  <textbox id="textRTL" type="autocomplete" autocompletesearch="simple"/>
13
14  <!-- test results are displayed in the html:body -->
15  <body xmlns="http://www.w3.org/1999/xhtml">
16  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649840"
17     target="_blank">Mozilla Bug 649840</a>
18  </body>
19
20  <!-- test code goes here -->
21  <script type="application/javascript">
22  <![CDATA[
23/** Test for Bug 649840 **/
24
25SimpleTest.waitForExplicitFinish();
26addLoadEvent(runTest);
27
28function runTest()
29{
30  var textLTR = $("textLTR");
31  var textRTL = $("textRTL");
32
33  textLTR.style.direction = "ltr";
34  textRTL.style.direction = "rtl";
35
36  textLTR.value="abcd";
37  textRTL.value="????";
38
39  // open and close the popups to update the popupdir attribute value
40  textLTR.openPopup();
41  textLTR.closePopup();
42  textRTL.openPopup();
43  textRTL.closePopup();
44  
45  is(textLTR.popup.style.direction, textLTR.style.direction, "LTR textbox test fails");
46  is(textRTL.popup.style.direction, textRTL.style.direction, "RTL textbox test fails");
47
48  // switch directions of the two textboxes
49  textLTR.style.direction = "rtl";
50  textRTL.style.direction = "ltr";
51
52  // open and close the popups to update the popupdir attribute value
53  textLTR.openPopup();
54  textLTR.closePopup();
55  textRTL.openPopup();
56  textRTL.closePopup();
57
58  is(textLTR.popup.style.direction, textLTR.style.direction, "RTL-switched textbox test fails");
59  is(textRTL.popup.style.direction, textRTL.style.direction, "LTR-switched textbox test fails");
60
61  SimpleTest.finish();
62}
63
64  ]]>
65  </script>
66</window>