Bug 1280947 - Remove dead File object construction code; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 25 Aug 2016 14:15:21 +0100
changeset 405526 12b9f7ab391f72405d6fcd9e9d34af24448a1d6e
parent 405525 a05fe11bfc556bb31c471f29aaa9bab40160aa5f
child 405527 ef00356abe0aebb8018d659af3360a53893e0e05
push id27513
push userbmo:ato@mozilla.com
push dateThu, 25 Aug 2016 16:05:24 +0000
reviewersautomatedtester
bugs1280947
milestone51.0a1
Bug 1280947 - Remove dead File object construction code; r?automatedtester MozReview-Commit-ID: 2e2tikS8evx
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2017,46 +2017,17 @@ GeckoDriver.prototype.sendKeysToElement 
     case Context.CHROME:
       let win = this.getCurrentWindow();
       let el = this.curBrowser.seenEls.get(id, {frame: win});
       yield interaction.sendKeysToElement(
           el, value, true, this.sessionCapabilities.raisesAccessibilityExceptions);
       break;
 
     case Context.CONTENT:
-      let err;
-      let listener = function(msg) {
-        this.mm.removeMessageListener("Marionette:setElementValue", listener);
-
-        let val = msg.data.value;
-        let el = msg.objects.element;
-        let win = this.getCurrentWindow();
-
-        if (el.type == "file") {
-          Cu.importGlobalProperties(["File"]);
-          let fs = Array.prototype.slice.call(el.files);
-          let file;
-          try {
-            file = new File(val);
-          } catch (e) {
-            err = new InvalidArgumentError(`File not found: ${val}`);
-          }
-          fs.push(file);
-          el.mozSetFileArray(fs);
-        } else {
-          el.value = val;
-        }
-      }.bind(this);
-
-      this.mm.addMessageListener("Marionette:setElementValue", listener);
       yield this.listener.sendKeysToElement({id: id, value: value});
-      this.mm.removeMessageListener("Marionette:setElementValue", listener);
-      if (err) {
-        throw err;
-      }
       break;
   }
 };
 
 /** Sets the test name.  The test name is used for logging purposes. */
 GeckoDriver.prototype.setTestName = function*(cmd, resp) {
   let val = cmd.parameters.value;
   this.testName = val;