Bug 1353074 - Components ctor test should not throw; r=maja_zf, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 03 Apr 2017 19:20:19 +0100
changeset 396291 6f07c769efddb3071fbd5a8730d8f651c6a9b967
parent 396290 d47a756d658a3e418a947f2d5141e32a6f48295a
child 396292 9bef2dfbd584c0f3ae52953bfc3aed64e308960d
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1353074
milestone54.0
Bug 1353074 - Components ctor test should not throw; r=maja_zf, a=test-only 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
@@ -338,18 +338,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');")