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
--- 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