Bug 1353074 - Components ctor test should not throw; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 03 Apr 2017 19:20:19 +0100
changeset 555147 3b21123154d54146d141c559e6ee1449e0a821cf
parent 555146 3fd82c76cadf8803ef93debaad5a63c14b250bc5
child 622547 cf36026715ebd3416809d6fa2bf0bdeba001e1fe
push id52171
push userbmo:ato@mozilla.com
push dateMon, 03 Apr 2017 18:22:15 +0000
reviewersmaja_zf
bugs1353074
milestone55.0a1
Bug 1353074 - Components ctor test should not throw; r?maja_zf Testing the return value is misleading in this case. What we want to test is that it does not throw due to a permissions issue. MozReview-Commit-ID: 2Wbwou9opyF
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
@@ -341,18 +341,18 @@ class TestExecuteChrome(WindowManagerMix
         super(TestExecuteChrome, self).setUp()
 
         self.marionette.set_context("chrome")
 
     def tearDown(self):
         super(TestExecuteChrome, self).tearDown()
 
     def test_permission(self):
-        self.assertEqual(1, self.marionette.execute_script("""
-            var c = Components.classes["@mozilla.org/preferences-service;1"]; return 1;"""))
+        self.marionette.execute_script(
+            "Components.classes['@mozilla.org/preferences-service;1']")
 
     @skip_if_mobile("New windows not supported in Fennec")
     def test_unmarshal_element_collection(self):
 
         def open_window_with_js():
             self.marionette.execute_script(
                 "window.open('chrome://marionette/content/test.xul', 'xul', 'chrome');")