Bug 754278 - Support floats in executeScript arguments, r=jgriffin, DONTBUILD because NPOTB

This commit is contained in:
David Burns 2012-05-15 13:20:57 -07:00
parent 56e49c1b75
commit 37c8d1d890
2 changed files with 8 additions and 1 deletions

View File

@ -295,7 +295,7 @@ class Marionette(object):
elif type(args) == HTMLElement:
wrapped = {'ELEMENT': args.id }
elif (isinstance(args, bool) or isinstance(args, basestring) or
isinstance(args, int) or args is None):
isinstance(args, int) or isinstance(args, float) or args is None):
wrapped = args
return wrapped

View File

@ -75,6 +75,13 @@ let prefs = Components.classes["@mozilla.org/preferences-service;1"]
self.marionette.execute_script("global.barfoo = [42, 23];")
self.assertEqual(self.marionette.execute_script("return global.barfoo;", new_sandbox=False), [42, 23])
def test_that_we_can_pass_in_floats(self):
expected_result = 1.2
result = self.marionette.execute_script("return arguments[0]",
[expected_result])
self.assertTrue(isinstance(result, float))
self.assertEqual(result, expected_result)
class TestExecuteChrome(TestExecuteContent):
def setUp(self):
super(TestExecuteChrome, self).setUp()