Bug 1257523 - Remove GeckoDriver#deleteFile; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 17 Mar 2016 14:26:57 +0000
changeset 341639 423e8cf61d19924a6326ab840129d52e40d5dcab
parent 341638 1e6a9b36ed358fdba3423833f4bec5074c3cc67e
child 341640 12942080c6ab03053f0fe987076076bd7c291ea3
push id13254
push userbmo:ato@mozilla.com
push dateThu, 17 Mar 2016 14:36:37 +0000
reviewersautomatedtester
bugs1257523
milestone48.0a1
Bug 1257523 - Remove GeckoDriver#deleteFile; r?automatedtester MozReview-Commit-ID: 7kOZ5hVC5He
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -389,29 +389,16 @@ GeckoDriver.prototype.getVisibleText = f
   } catch (e) {
     if (el.nodeName == "#text") {
       lines.push(el.textContent);
     }
   }
 };
 
 /**
-  * Given a file name, this will delete the file from the temp directory
-  * if it exists.
-  *
-  * @param {string} filename
-  */
-GeckoDriver.prototype.deleteFile = function(filename) {
-  let file = FileUtils.getFile("TmpD", [filename.toString()]);
-  if (file.exists()) {
-    file.remove(true);
-  }
-};
-
-/**
  * Handles registration of new content listener browsers.  Depending on
  * their type they are either accepted or ignored.
  */
 GeckoDriver.prototype.registerBrowser = function(id, be) {
   let nullPrevious = this.curBrowser.curFrameId === null;
   let listenerWindow = Services.wm.getOuterWindowWithId(id);
 
   // go in here if we're already in a remote frame
@@ -2462,18 +2449,16 @@ GeckoDriver.prototype.sessionTearDown = 
 
   // reset frame to the top-most frame
   this.curFrame = null;
   if (this.mainFrame) {
     this.mainFrame.focus();
   }
 
   this.sessionId = null;
-  this.deleteFile("marionetteChromeScripts");
-  this.deleteFile("marionetteContentScripts");
 
   if (this.observing !== null) {
     for (let topic in this.observing) {
       Services.obs.removeObserver(this.observing[topic], topic);
     }
     this.observing = null;
   }
   this.sandboxes = {};