From 31840306ac51c40515ef1950f15fc304b9885712 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Mon, 3 Apr 2017 19:18:25 +0100 Subject: [PATCH] Bug 1353074 - Run Components permission test in all sandboxes; r=maja_zf The Components.classes constructor should throw an error in both the mutable and the "default" sandbox. MozReview-Commit-ID: C40nZNaVWwz --HG-- extra : rebase_source : f02506f16ff409761ba09ae0f32ff2902cdf07a3 --- .../marionette_harness/tests/unit/test_execute_script.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py index 4eaf3acba8a7..fcc3b2349083 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py @@ -164,10 +164,10 @@ class TestExecuteContent(MarionetteTestCase): self.assertIn("return b", cm.exception.stacktrace) def test_permission(self): - with self.assertRaises(errors.JavascriptException): - self.marionette.execute_script(""" - var c = Components.classes["@mozilla.org/preferences-service;1"]; - """) + for sandbox in ["default", None]: + with self.assertRaises(errors.JavascriptException): + self.marionette.execute_script( + "Components.classes['@mozilla.org/preferences-service;1']") def test_return_web_element(self): self.marionette.navigate(elements)