Bug 1324373 - Fix Javascript errors in Marionette's get_pref() method. r=ato, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Tue, 20 Dec 2016 10:30:39 +0100
changeset 353205 09632247e771a8cc0e49782fbe5e2816b2ed481e
parent 353204 2638daa602187f2f8e4c9510c659ce0ca5251711
child 353206 11cb02dcabd97f188a879a903ced51db423c966f
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1324373
milestone52.0a2
Bug 1324373 - Fix Javascript errors in Marionette's get_pref() method. r=ato, a=test-only Given that all other code is using Components.interfaces it should also be used in get_pref(). Further arguments is not iterable in older Firefox releases, so we cannot use the unfolding - it would break Firefox UI update tests for Firefox 45ESR -> 52ESR. MozReview-Commit-ID: LZNdkW9XBvy
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -978,20 +978,22 @@ class Marionette(object):
         Usage example::
             marionette.get_pref("browser.tabs.warnOnClose")
 
         """
         with self.using_context(self.CONTEXT_CHROME):
             pref_value = self.execute_script("""
                 Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-                let [pref, defaultBranch, valueType] = arguments;
+                let pref = arguments[0];
+                let defaultBranch = arguments[1];
+                let valueType = arguments[2];
 
                 prefs = new Preferences({defaultBranch: defaultBranch});
-                return prefs.get(pref, null, valueType=Ci[valueType]);
+                return prefs.get(pref, null, Components.interfaces[valueType]);
                 """, script_args=(pref, default_branch, value_type))
             return pref_value
 
     def set_pref(self, pref, value, default_branch=False):
         """Set the value of the specified preference.
 
         :param pref: Name of the preference.
         :param value: The value to set the preference to. If the value is None,
@@ -1009,17 +1011,19 @@ class Marionette(object):
         with self.using_context(self.CONTEXT_CHROME):
             if value is None:
                 self.clear_pref(pref)
                 return
 
             self.execute_script("""
                 Components.utils.import("resource://gre/modules/Preferences.jsm");
 
-                let [pref, value, defaultBranch] = arguments;
+                let pref = arguments[0];
+                let value = arguments[1];
+                let defaultBranch = arguments[2];
 
                 prefs = new Preferences({defaultBranch: defaultBranch});
                 prefs.set(pref, value);
                 """, script_args=(pref, value, default_branch))
 
     def set_prefs(self, prefs, default_branch=False):
         """Set the value of a list of preferences.