Bug 1353074 - Use tuples for script arguments; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 03 Apr 2017 19:14:16 +0100
changeset 555142 15d5be4545322d99a3fa00c2a22e2641012ca2e8
parent 555141 d8d3ef8f703158df813859eab02042c647ed7a8d
child 555143 d629b966998bde20e52a992ed326af2de79485aa
push id52171
push userbmo:ato@mozilla.com
push dateMon, 03 Apr 2017 18:22:15 +0000
reviewersmaja_zf
bugs1353074
milestone55.0a1
Bug 1353074 - Use tuples for script arguments; r?maja_zf We only allow a list type for backwards compatibility. Tuples is what is recommended because of interoperability with the Python standard library. MozReview-Commit-ID: 72zPzYvBz7Q
testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py
@@ -91,34 +91,34 @@ class TestExecuteContent(MarionetteTestC
     def test_no_return_value(self):
         self.assertIsNone(self.marionette.execute_script("true"))
 
     def test_argument_null(self):
         self.assertIsNone(self.marionette.execute_script("return arguments[0]", [None]))
 
     def test_argument_number(self):
         self.assertEqual(
-            1, self.marionette.execute_script("return arguments[0]", [1]))
+            1, self.marionette.execute_script("return arguments[0]", (1,)))
         self.assertEqual(
-            1.5, self.marionette.execute_script("return arguments[0]", [1.5]))
+            1.5, self.marionette.execute_script("return arguments[0]", (1.5,)))
 
     def test_argument_boolean(self):
-        self.assertTrue(self.marionette.execute_script("return arguments[0]", [True]))
+        self.assertTrue(self.marionette.execute_script("return arguments[0]", (True,)))
 
     def test_argument_string(self):
         self.assertEqual(
-            "foo", self.marionette.execute_script("return arguments[0]", ["foo"]))
+            "foo", self.marionette.execute_script("return arguments[0]", ("foo",)))
 
     def test_argument_array(self):
         self.assertEqual(
-            [1, 2], self.marionette.execute_script("return arguments[0]", [[1, 2]]))
+            [1, 2], self.marionette.execute_script("return arguments[0]", ([1, 2],)))
 
     def test_argument_object(self):
         self.assertEqual({"foo": 1}, self.marionette.execute_script(
-            "return arguments[0]", [{"foo": 1}]))
+            "return arguments[0]", ({"foo": 1},)))
 
     def test_globals(self):
         for property in globals:
             self.assert_is_defined(property)
         self.assert_is_defined("Components")
         self.assert_is_defined("window.wrappedJSObject")
 
     def test_system_globals(self):