Bug 751406 - Update tests which expect calling Components.classes to fail, a=test-only, DONTBUILD because NPOTB
authorJonathan Griffin <jgriffin@mozilla.com>
Wed, 09 May 2012 11:48:45 -0700
changeset 93614 53796df4a12e5c3d6c06836d281232c45150dc96
parent 93613 5f0d4464f4472cd6adb9ab80f3751f424b1695bc
child 93615 6d58828415d39318c2b9eb590c3f6c1b9599442d
push id9229
push userjgriffin@mozilla.com
push dateWed, 09 May 2012 18:49:39 +0000
treeherdermozilla-inbound@53796df4a12e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only, DONTBUILD
bugs751406
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 751406 - Update tests which expect calling Components.classes to fail, a=test-only, DONTBUILD because NPOTB
testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
testing/marionette/client/marionette/tests/unit/test_execute_script.py
--- a/testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
+++ b/testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
@@ -93,17 +93,18 @@ class TestExecuteAsyncContent(Marionette
 
     def test_script_finished(self):
         self.assertTrue(self.marionette.execute_async_script("""
             marionetteScriptFinished(true);
             """))
 
     def test_execute_permission(self):
         self.assertRaises(JavascriptException, self.marionette.execute_async_script, """
-var c = Components.classes;
+let prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                              .getService(Components.interfaces.nsIPrefBranch);
 marionetteScriptFinished(1);
 """)
 
 class TestExecuteAsyncChrome(TestExecuteAsyncContent):
     def setUp(self):
         super(TestExecuteAsyncChrome, self).setUp()
         self.marionette.set_context("chrome")
 
--- a/testing/marionette/client/marionette/tests/unit/test_execute_script.py
+++ b/testing/marionette/client/marionette/tests/unit/test_execute_script.py
@@ -48,17 +48,20 @@ class TestExecuteContent(MarionetteTestC
 
     def test_execute_js_exception(self):
         self.assertRaises(JavascriptException,
             self.marionette.execute_script, "return foo(bar);")
 
     def test_execute_permission(self):
         self.assertRaises(JavascriptException,
                           self.marionette.execute_script,
-                          "return Components.classes;")
+                          """
+let prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                              .getService(Components.interfaces.nsIPrefBranch);
+""")
 
     def test_complex_return_values(self):
         self.assertEqual(self.marionette.execute_script("return [1, 2];"), [1, 2])
         self.assertEqual(self.marionette.execute_script("return {'foo': 'bar', 'fizz': 'fazz'};"),
                          {'foo': 'bar', 'fizz': 'fazz'})
         self.assertEqual(self.marionette.execute_script("return [1, {'foo': 'bar'}, 2];"),
                          [1, {'foo': 'bar'}, 2])
         self.assertEqual(self.marionette.execute_script("return {'foo': [1, 'a', 2]};"),