Bug 1387678 - Update tests to not use shadow DOM like a frame; r=ato
authorDavid Burns <dburns@mozilla.com>
Wed, 09 May 2018 09:14:21 +0100
changeset 474553 3c9c76ca14ad5303b36ac5e2974c15b835da27fb
parent 474552 767a5600631790e20cffbd84cbc4fdeabde973eb
child 474554 20cdbb61468362eacc2a3c667099a808cf71a859
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1387678
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387678 - Update tests to not use shadow DOM like a frame; r=ato The current element finding and interaction code expects the shadow DOM to act like a frame when it comes to keeping references to elements found or not found on the document. This expectation is not correct for the way shadow DOM works in reality. MozReview-Commit-ID: JFWvlbEylj4
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
@@ -33,23 +33,16 @@ class TestShadowDom(MarionetteTestCase):
         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()
 
-    def test_shadow_dom_after_switch_away_from_shadow_root(self):
-        # Button in shadow root should be actionable
-        self.button.click()
-        self.marionette.switch_to_shadow_root()
-        # After switching back to top content, button should be stale
-        self.assertRaises(StaleElementException, self.button.click)
-
     def test_shadow_dom_raises_stale_element_exception_when_button_remove(self):
         self.marionette.execute_script(
             'document.getElementById("host").shadowRoot.getElementById("button").remove();')
         # After removing button from shadow DOM, button should be stale
         self.assertRaises(StaleElementException, self.button.click)
 
     def test_shadow_dom_raises_stale_element_exception_when_host_removed(self):
         self.marionette.execute_script('document.getElementById("host").remove();')
@@ -67,16 +60,8 @@ class TestShadowDom(MarionetteTestCase):
         # Button in shadow root should be actionable
         self.button.click()
         self.inner_host = self.marionette.find_element(By.ID, "inner-host")
         self.marionette.switch_to_shadow_root(self.inner_host)
         self.inner_button = self.marionette.find_element(By.ID, "inner-button")
         # Nested nutton in nested shadow root should be actionable
         self.inner_button.click()
         self.marionette.switch_to_shadow_root()
-        # After jumping back to parent shadow root, button should again be actionable but inner
-        # button should now be stale
-        self.button.click()
-        self.assertRaises(StaleElementException, self.inner_button.click)
-        self.marionette.switch_to_shadow_root()
-        # After switching back to top content, both buttons should now be stale
-        self.assertRaises(StaleElementException, self.button.click)
-        self.assertRaises(StaleElementException, self.inner_button.click)