Better test for bug 649840. r=ehsan. + bustage-fix by sgautherie.
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 31 Jan 2012 00:27:23 +0100
changeset 86931 8b6e498d5933ec76cfd6031d92d09437275b3597
parent 86930 2bdf77e42239b2cd300a6997f99d34e2403f3c93
child 86932 836b5e3bc8164fda8866dedf289335f07195f73a
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)
reviewersehsan
bugs649840
milestone12.0a1
Better test for bug 649840. r=ehsan. + bustage-fix by sgautherie.
toolkit/components/satchel/test/test_bug_511615.html
toolkit/content/tests/chrome/Makefile.in
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">
+<div id="content" style="direction: rtl;">
   <!-- 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,16 +27,17 @@ 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");
 
@@ -361,16 +362,17 @@ 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;
--- a/toolkit/content/tests/chrome/Makefile.in
+++ b/toolkit/content/tests/chrome/Makefile.in
@@ -67,17 +67,16 @@ include $(topsrcdir)/config/rules.mk
 		bug451286_window.xul \
 		test_bug451286.xul \
 		bug451540_window.xul \
 		test_bug451540.xul \
 		test_bug471776.xul \
 		test_bug570192.xul \
 		test_bug624329.xul \
 		bug624329_window.xul \
-		test_bug649840.xul \
 		test_popup_preventdefault_chrome.xul \
 		window_popup_preventdefault_chrome.xul \
 		test_largemenu.xul \
 		window_largemenu.xul \
 		test_popup_anchor.xul \
 		window_popup_anchor.xul \
 		frame_popup_anchor.xul \
 		test_preferences.xul \
deleted file mode 100644
--- a/toolkit/content/tests/chrome/test_bug649840.xul
+++ /dev/null
@@ -1,66 +0,0 @@
-<?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>