Bug 1353074 - Components ctor test should not throw; r=maja_zf
☠☠ backed out by 7c7029cf53f5 ☠ ☠
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 03 Apr 2017 19:20:19 +0100
changeset 558293 0c075043bc43c7d312d7d7147ff4ea4f9aa71b2b
parent 558292 001f220710a211db655f98aa08b40d7b5911e4fc
child 558294 596704d5da990d8aa7752b92aabf67faebd98717
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +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
@@ -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');")