Bug 1326047 - Remove usage of enforce_gecko_prefs() from test_shadow_dom.py. r=ato, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Fri, 06 Jan 2017 09:43:43 +0100
changeset 353408 1c83035673d00cad18406588f739645ab58c116b
parent 353407 1a09f3ea15d15069bc287db1c85427386204381f
child 353409 4e8559ebed8f6230b413404125d31077e168df6a
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1326047
milestone52.0a2
Bug 1326047 - Remove usage of enforce_gecko_prefs() from test_shadow_dom.py. r=ato, a=test-only Flipping the preference "dom.webcomponents.enabled" doesn't require a restart. As such there is no need to use enforce_gecko_prefs(). MozReview-Commit-ID: 6sl1xycwWII
testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_shadow_dom.py
@@ -10,24 +10,28 @@ from marionette_driver.errors import (
 )
 
 from marionette_harness import MarionetteTestCase
 
 
 class TestShadowDom(MarionetteTestCase):
 
     def setUp(self):
-        MarionetteTestCase.setUp(self)
-        self.marionette.enforce_gecko_prefs({"dom.webcomponents.enabled": True})
+        super(TestShadowDom, self).setUp()
+        self.marionette.set_pref("dom.webcomponents.enabled", True)
         self.marionette.navigate(self.marionette.absolute_url("test_shadow_dom.html"))
 
         self.host = self.marionette.find_element(By.ID, "host")
         self.marionette.switch_to_shadow_root(self.host)
         self.button = self.marionette.find_element(By.ID, "button")
 
+    def tearDown(self):
+        self.marionette.clear_pref("dom.webcomponents.enabled")
+        super(TestShadowDom, self).tearDown()
+
     def test_chrome_error(self):
         with self.marionette.using_context("chrome"):
             self.assertRaises(UnsupportedOperationException,
                               self.marionette.switch_to_shadow_root)
 
     def test_shadow_dom(self):
         # Button in shadow root should be actionable
         self.button.click()