Backout 8705f07a49ec (bug 649840) for bustage
authorEd Morley <bmo@edmorley.co.uk>
Mon, 30 Jan 2012 23:20:54 +0000
changeset 86930 2bdf77e42239b2cd300a6997f99d34e2403f3c93
parent 86929 8705f07a49ecca80089c21be7cfc7d795baec728
child 86931 8b6e498d5933ec76cfd6031d92d09437275b3597
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs649840
milestone12.0a1
backs out8705f07a49ecca80089c21be7cfc7d795baec728
Backout 8705f07a49ec (bug 649840) for bustage
toolkit/components/satchel/test/test_bug_511615.html
toolkit/content/tests/chrome/test_bug649840.xul
--- a/toolkit/components/satchel/test/test_bug_511615.html
+++ b/toolkit/components/satchel/test/test_bug_511615.html
@@ -7,17 +7,17 @@
   <script type="text/javascript" src="satchel_common.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 Form History test: form field autocomplete
 <p id="display"></p>
 
 <!-- we presumably can't hide the content for this test. -->
-<div id="content" style="direction: rtl;">
+<div id="content">
   <!-- unused -->
   <form id="unused" onsubmit="return false;">
     <input  type="text" name="field1" value="unused">
   </form>
 
   <!-- normal, basic form -->
   <form id="form1" onsubmit="return false;">
     <input  type="text" name="field1">
@@ -27,17 +27,16 @@ Form History test: form field autocomple
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Form History autocomplete **/
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 var autocompletePopup = getAutocompletePopup();
-autocompletePopup.style.direction = "ltr";
 
 var input = $_(1, "field1");
 
 // Get the form history service
 var fh = Components.classes["@mozilla.org/satchel/form-history;1"].
          getService(Components.interfaces.nsIFormHistory2);
 ok(fh != null, "got form history service");
 
@@ -362,17 +361,16 @@ function runTest(testNum) {
     case 210:
         // Need to use doKey(), even though this test is not privileged.
         doKey("escape");
         nextTestPrivledged = true;
         break;
     case 211:
         checkPopupOpen(false);
         checkForm("");
-        is(autocompletePopup.style.direction, "rtl", "direction should have been changed from ltr to rtl");
 
         SimpleTest.finish();
         return;
 
     default:
         ok(false, "Unexpected invocation of test #" + testNum);
         SimpleTest.finish();
         return;
new file mode 100644
--- /dev/null
+++ b/toolkit/content/tests/chrome/test_bug649840.xul
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
+<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=649840
+-->
+<window title="Mozilla Bug 649840" 
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
+
+  <textbox id="textLTR" type="autocomplete" autocompletesearch="simple"/>
+  <textbox id="textRTL" type="autocomplete" autocompletesearch="simple"/>
+
+  <!-- test results are displayed in the html:body -->
+  <body xmlns="http://www.w3.org/1999/xhtml">
+  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649840"
+     target="_blank">Mozilla Bug 649840</a>
+  </body>
+
+  <!-- test code goes here -->
+  <script type="application/javascript">
+  <![CDATA[
+/** Test for Bug 649840 **/
+
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(runTest);
+
+function runTest()
+{
+  var textLTR = $("textLTR");
+  var textRTL = $("textRTL");
+
+  textLTR.style.direction = "ltr";
+  textRTL.style.direction = "rtl";
+
+  textLTR.value="abcd";
+  textRTL.value="ابجد";
+
+  // open and close the popups to update the popupdir attribute value
+  textLTR.openPopup();
+  textLTR.closePopup();
+  textRTL.openPopup();
+  textRTL.closePopup();
+  
+  is(textLTR.popup.style.direction, textLTR.style.direction, "LTR textbox test fails");
+  is(textRTL.popup.style.direction, textRTL.style.direction, "RTL textbox test fails");
+
+  // switch directions of the two textboxes
+  textLTR.style.direction = "rtl";
+  textRTL.style.direction = "ltr";
+
+  // open and close the popups to update the popupdir attribute value
+  textLTR.openPopup();
+  textLTR.closePopup();
+  textRTL.openPopup();
+  textRTL.closePopup();
+
+  is(textLTR.popup.style.direction, textLTR.style.direction, "RTL-switched textbox test fails");
+  is(textRTL.popup.style.direction, textRTL.style.direction, "LTR-switched textbox test fails");
+
+  SimpleTest.finish();
+}
+
+  ]]>
+  </script>
+</window>