From b60ce7b2b2777791cca071aa03618dcf3e4ef11f Mon Sep 17 00:00:00 2001 From: Aus Lacroix Date: Wed, 26 Aug 2015 03:29:21 -0700 Subject: [PATCH 01/14] Bug 1198172 - Backout for bug 1191432, appears to be causing major issues for Gij on Gaia. r=me --HG-- extra : amend_source : ae5ef2aec7ebc04b3682419da5ee09c76da80d2c --- .../tests/unit/test_accessibility.py | 66 ++----------------- .../marionette/www/test_accessibility.html | 15 ----- testing/marionette/elements.js | 2 - testing/marionette/listener.js | 52 ++------------- 4 files changed, 12 insertions(+), 123 deletions(-) diff --git a/testing/marionette/client/marionette/tests/unit/test_accessibility.py b/testing/marionette/client/marionette/tests/unit/test_accessibility.py index ebd5c154418d..0863aeacf739 100644 --- a/testing/marionette/client/marionette/tests/unit/test_accessibility.py +++ b/testing/marionette/client/marionette/tests/unit/test_accessibility.py @@ -4,7 +4,7 @@ from marionette import MarionetteTestCase from marionette_driver.errors import (ElementNotAccessibleException, - ElementNotVisibleException) + ElementNotVisibleException) class TestAccessibility(MarionetteTestCase): @@ -16,13 +16,7 @@ class TestAccessibility(MarionetteTestCase): "button1", # Button2 is an accessible button with a valid accessible name # computed from aria-label - "button2", - # Button13 is an accessible button that is implemented via role="button" - # and is explorable using tabindex="0" - "button13", - # button17 is an accessible button that overrides parent's - # pointer-events:none; property with its own pointer-events:all; - "button17" + "button2" ] # Elements that are not accessible with the accessibility API @@ -41,10 +35,7 @@ class TestAccessibility(MarionetteTestCase): "button7", # Button8 is not currently visible via the accessibility API and may # not be manipulated by it (in hidden subtree) - "button8", - # Button14 is accessible button but is not explorable because of lack - # of tabindex that would make it focusable. - "button14" + "button8" ] # Elements that are either accessible to accessibility API or not accessible @@ -66,12 +57,6 @@ class TestAccessibility(MarionetteTestCase): disabled_elementIDs = ["button11", "no_accessible_but_disabled"] - # Elements that are enabled but otherwise disabled or not explorable via the accessibility API - disabled_accessibility_elementIDs = ["button12", "button15", "button16"] - - # Elements that are reporting selected state - valid_option_elementIDs = ["option1", "option2"] - def run_element_test(self, ids, testFn): for id in ids: element = self.marionette.find_element("id", id) @@ -144,50 +129,13 @@ class TestAccessibility(MarionetteTestCase): # No exception should be raised self.run_element_test(self.displayed_elementIDs, lambda element: element.is_displayed()) - def test_element_is_not_enabled_to_accessbility(self): + def test_is_element_is_not_enabled_to_accessbility(self): self.setup_accessibility() - # Buttons are enabled but disabled/not-explorable via the accessibility API - self.run_element_test(self.disabled_accessibility_elementIDs, - lambda element: self.assertRaises(ElementNotAccessibleException, - element.is_enabled)) - - # Buttons are enabled but disabled/not-explorable via the accessibility API and thus are not - # clickable via the accessibility API - self.run_element_test(self.disabled_accessibility_elementIDs, - lambda element: self.assertRaises(ElementNotAccessibleException, - element.click)) - - self.setup_accessibility(False, False) - self.run_element_test(self.disabled_accessibility_elementIDs, - lambda element: element.is_enabled()) - self.run_element_test(self.disabled_accessibility_elementIDs, - lambda element: element.click()) + # Button is enabled but disabled via the accessibility API + self.assertRaises(ElementNotAccessibleException, + self.marionette.find_element("id", "button12").is_enabled) def test_element_is_enabled_to_accessibility(self): self.setup_accessibility() # No exception should be raised self.run_element_test(self.disabled_elementIDs, lambda element: element.is_enabled()) - - def test_send_keys_raises_no_exception(self): - self.setup_accessibility() - # Sending keys to valid input should not raise any exceptions - self.run_element_test(['input1'], lambda element: element.send_keys("a")) - - self.setup_accessibility(False, False) - # Sending keys to invalid element should not raise any exceptions when raising accessibility - # exceptions is disabled - self.run_element_test(['button5'], lambda element: element.send_keys("abc")) - - def test_send_keys_raises_element_not_accessible(self): - self.setup_accessibility() - # Sending keys to invalid element should raise an exception - self.run_element_test(['button5'], - lambda element: self.assertRaises(ElementNotAccessibleException, - element.send_keys)) - - def test_is_selected_raises_no_exception(self): - self.setup_accessibility() - # No exception should be raised for valid options - self.run_element_test(self.valid_option_elementIDs, lambda element: element.is_selected()) - # No exception should be raised for non-selectable elements - self.run_element_test(self.valid_elementIDs, lambda element: element.is_selected()) diff --git a/testing/marionette/client/marionette/www/test_accessibility.html b/testing/marionette/client/marionette/www/test_accessibility.html index 8cc9fd64930c..8838ce869974 100644 --- a/testing/marionette/client/marionette/www/test_accessibility.html +++ b/testing/marionette/client/marionette/www/test_accessibility.html @@ -32,22 +32,7 @@ I have no accessible object - Span button - Unexplorable Span button - -
- -
-
- -
- -