Bug 1370857 - Remove Marionette.clear_imported_scripts API; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Wed, 07 Jun 2017 13:12:46 +0100
changeset 591108 51469f677a416e295efbf4cc1ceed9d2fe1a28e2
parent 591094 e61060be36424240058f8bef4c5597f401bc8b7e
child 591109 52f2d2d8fce72827e2b6a76293790a4f9f0284a2
push id62965
push userbmo:ato@mozilla.com
push dateThu, 08 Jun 2017 17:35:33 +0000
reviewersautomatedtester
bugs1370857, 1368648
milestone55.0a1
Bug 1370857 - Remove Marionette.clear_imported_scripts API; r?automatedtester The import script functionality was removed in https://bugzilla.mozilla.org/show_bug.cgi?id=1368648, but the Marionette.clear_imported_script API was not removed from the client. We are currently making calls after every test to the clearImportedScripts command in the server, but we are apparently ignoring the ‘unknown command’ error that is being returned. MozReview-Commit-ID: KVjh2IfhuUY
testing/marionette/client/marionette_driver/marionette.py
testing/marionette/harness/marionette_harness/marionette_test/testcases.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1894,24 +1894,16 @@ class Marionette(object):
             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 clear_imported_scripts(self):
-        """Clears all imported scripts in this context, ie: calling
-        clear_imported_scripts in chrome context will clear only scripts
-        you imported in chrome, and will leave the scripts you imported
-        in content context.
-        """
-        self._send_message("clearImportedScripts")
-
     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:
--- a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py
+++ b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py
@@ -341,17 +341,16 @@ class MarionetteTestCase(CommonTestCase)
     def tearDown(self):
         # In the case no session is active (eg. the application was quit), start
         # a new session for clean-up steps.
         if not self.marionette.session:
             self.marionette.start_session()
 
         if not self.marionette.crashed:
             try:
-                self.marionette.clear_imported_scripts()
                 self.marionette.execute_script("log('TEST-END: {0}')"
                                                .format(self.test_name),
                                                sandbox="simpletest")
                 self.marionette.test_name = None
             except (MarionetteException, IOError):
                 # We have tried to log the test end when there is no listener
                 # object that we can access
                 pass