update tests for refactored input implementation (bug 594687). r=Neil
authorBruno 'Aqualon' Escherl <bruno@escherl.net>
Thu, 09 Sep 2010 14:18:14 +0200
changeset 6348 3747f1d60f0a690d2298bd17b964db6360092a7e
parent 6347 2bcd6ba4d38e9797c3eb0ee0c7f461c2964e9090
child 6349 bcb4ed3a3eb96dab70953066bb3aba499f9770fb
push id4896
push userCallek@gmail.com
push dateFri, 10 Sep 2010 03:53:03 +0000
treeherdercomm-central@3747f1d60f0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs594687
update tests for refactored input implementation (bug 594687). r=Neil [SeaMonkey 2.1, mochitest-browser-chrome] FAILING browser_346337.js and browser_466937.js
suite/common/tests/browser/browser_346337.js
suite/common/tests/browser/browser_466937.js
--- a/suite/common/tests/browser/browser_346337.js
+++ b/suite/common/tests/browser/browser_346337.js
@@ -38,32 +38,43 @@ function test() {
   /** Test for Bug 346337 **/
   
   try {
     var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
                        .getService(Components.interfaces.nsISessionStore);
   }
   catch (ex) { }
 
+  var file = Components.classes["@mozilla.org/file/directory_service;1"]
+               .getService(Components.interfaces.nsIProperties)
+               .get("TmpD", Components.interfaces.nsILocalFile);
+  file.append("346337_test1.file");
+  filePath1 = file.path;
+  file = Components.classes["@mozilla.org/file/directory_service;1"]
+             .getService(Components.interfaces.nsIProperties)
+             .get("TmpD", Components.interfaces.nsILocalFile);
+  file.append("346337_test2.file");
+  filePath2 = file.path;
+
   let fieldList = {
     "//input[@name='input']":     Date.now().toString(),
     "//input[@name='spaced 1']":  Math.random().toString(),
     "//input[3]":                 "three",
     "//input[@type='checkbox']":  true,
     "//input[@name='uncheck']":   false,
     "//input[@type='radio'][1]":  false,
     "//input[@type='radio'][2]":  true,
     "//input[@type='radio'][3]":  false,
     "//select":                   2,
     "//select[@multiple]":        [1, 3],
     "//textarea[1]":              "",
     "//textarea[2]":              "Some text... " + Math.random(),
     "//textarea[3]":              "Some more text\n" + new Date(),
-    "//input[@type='file'][1]":   ["/dev/null"],
-    "//input[@type='file'][2]":   ["/dev/null", "/dev/stdin"]
+    "//input[@type='file'][1]":   [filePath1],
+    "//input[@type='file'][2]":   [filePath1, filePath2]
   };
   
   function getElementByXPath(aTab, aQuery) {
     let doc = aTab.linkedBrowser.contentDocument;
     let xptype = Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
     return doc.evaluate(aQuery, doc, null, xptype, null).singleNodeValue;
   }
   
--- a/suite/common/tests/browser/browser_466937.js
+++ b/suite/common/tests/browser/browser_466937.js
@@ -39,19 +39,24 @@ function test() {
   
   try {
     var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
                        .getService(Components.interfaces.nsISessionStore);
   }
   catch (ex) { }
   waitForExplicitFinish();
   
+  var file = Components.classes["@mozilla.org/file/directory_service;1"]
+             .getService(Components.interfaces.nsIProperties)
+             .get("TmpD", Components.interfaces.nsILocalFile);
+  file.append("466937_test.file");
+  let testPath = file.path;
+  
   let testURL = "http://mochi.test:8888/browser/" +
     "suite/common/tests/browser/browser_466937_sample.html";
-  let testPath = "/home/user/regular.file";
   
   let tab = getBrowser().addTab(testURL);
   let window = tab.ownerDocument.defaultView;
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     doc.getElementById("reverse_thief").value = "/home/user/secret2";
     doc.getElementById("bystander").value = testPath;