Bug 1353074 - Run wrappedJSObject execute script tests in all sandboxes; r=maja_zf

MozReview-Commit-ID: 5u2u5alGb7Z

--HG--
extra : rebase_source : 679b2932b9aeca0b6ade4604a491da0d8c5b5d3f
This commit is contained in:
Andreas Tolfsen 2017-04-03 19:19:05 +01:00
Родитель 765ed14a32
Коммит ee6b3f2172
1 изменённых файлов: 25 добавлений и 6 удалений

Просмотреть файл

@ -210,21 +210,34 @@ class TestExecuteContent(MarionetteTestCase):
self.assertEqual(self.marionette.execute_script(
"return this.foobar", new_sandbox=False), [23, 42])
def test_wrappedjsobject(self):
def test_mutable_sandbox_wrappedjsobject(self):
self.assert_is_defined("window.wrappedJSObject")
with self.assertRaises(errors.JavascriptException):
self.marionette.execute_script("window.wrappedJSObject.foo = 1", sandbox=None)
def test_default_sandbox_wrappedjsobject(self):
self.assert_is_defined("window.wrappedJSObject", sandbox="default")
try:
self.marionette.execute_script("window.wrappedJSObject.foo = 3")
self.assertEqual(
self.marionette.execute_script("return window.wrappedJSObject.foo"), 3)
self.marionette.execute_script(
"window.wrappedJSObject.foo = 4", sandbox="default")
self.assertEqual(self.marionette.execute_script(
"return window.wrappedJSObject.foo", sandbox="default"), 4)
finally:
self.marionette.execute_script("delete window.wrappedJSObject.foo")
self.marionette.execute_script(
"delete window.wrappedJSObject.foo", sandbox="default")
def test_system_sandbox_wrappedjsobject(self):
self.assert_is_defined("window.wrappedJSObject", sandbox="system")
self.marionette.execute_script(
"window.wrappedJSObject.foo = 4", sandbox="system")
self.assertEqual(self.marionette.execute_script(
"return window.wrappedJSObject.foo", sandbox="system"), 4)
def test_system_dead_object(self):
self.assert_is_defined("window.wrappedJSObject", sandbox="system")
self.marionette.execute_script(
"window.wrappedJSObject.foo = function() { return 'yo' }",
sandbox="system")
@ -374,7 +387,13 @@ class TestExecuteChrome(WindowManagerMixin, TestExecuteContent):
def test_window_set_timeout_is_not_cancelled(self):
pass
def test_privileged_code_inspection(self):
def test_mutable_sandbox_wrappedjsobject(self):
pass
def test_default_sandbox_wrappedjsobject(self):
pass
def test_system_sandbox_wrappedjsobject(self):
pass
def test_access_chrome_objects_in_event_listeners(self):