Bug 1370857 - Remove Marionette.import_script API; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Wed, 07 Jun 2017 13:13:50 +0100
changeset 591109 52f2d2d8fce72827e2b6a76293790a4f9f0284a2
parent 591108 51469f677a416e295efbf4cc1ceed9d2fe1a28e2
child 632435 ca3ad4bce8dc0240113f0e106986723a86413830
push id62965
push userbmo:ato@mozilla.com
push dateThu, 08 Jun 2017 17:35:33 +0000
reviewersautomatedtester
bugs1370857
milestone55.0a1
Bug 1370857 - Remove Marionette.import_script API; r?automatedtester Removes the Marionette.import_script API as it is not used by any consumers of the client, including the Firefox UI tests. MozReview-Commit-ID: 3xceYXZZVR0
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1864,46 +1864,16 @@ class Marionette(object):
             marionette.log("I AM ERROR", "ERROR")
             logs = marionette.get_logs()
             assert logs[0][1] == "I AM INFO"
             assert logs[1][1] == "I AM ERROR"
         """
         return self._send_message("getLogs",
                                   key="value" if self.protocol == 1 else None)
 
-    def import_script(self, js_file):
-        """Imports a script into the scope of the execute_script and
-        execute_async_script calls.
-
-        This is particularly useful if you wish to import your own
-        libraries.
-
-        :param js_file: Filename of JavaScript file to import.
-
-        For example, Say you have a script, importfunc.js, that contains:
-
-        ::
-
-            let testFunc = function() { return "i'm a test function!";};
-
-        Assuming this file is in the same directory as the test, you
-        could do something like:
-
-        ::
-
-            js = os.path.abspath(os.path.join(__file__, os.path.pardir, "importfunc.js"))
-            marionette.import_script(js)
-            assert "i'm a test function!" == self.marionette.execute_script("return testFunc();")
-        """
-        js = ""
-        with open(js_file, "r") as f:
-            js = f.read()
-        body = {"script": js}
-        self._send_message("importScript", body)
-
     def add_cookie(self, cookie):
         """Adds a cookie to your current session.
 
         :param cookie: A dictionary object, with required keys - "name"
             and "value"; optional keys - "path", "domain", "secure",
             "expiry".
 
         Usage example: