Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #22233 from anvk/1024501
Browse files Browse the repository at this point in the history
1024501: Enable accessibility settings when the screen reader is enabled with quick toggle. r=alive
  • Loading branch information
yzen committed Aug 1, 2014
2 parents 8044e0c + f71186e commit 577efee
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/system/js/accessibility.js
Expand Up @@ -105,6 +105,14 @@
SettingsListener.observe(settingKey, this.settings[settingKey],
function observe(aValue) {
this.settings[settingKey] = aValue;

// Show/Hide Accessibility Panel whenever volume buttons
// trigger Screen Reader
if (settingKey === 'accessibility.screenreader') {
SettingsListener.getSettingsLock().set({
'accessibility.show-settings': aValue
});
}
}.bind(this));
}, this);
},
Expand Down
Expand Up @@ -6,3 +6,4 @@ b2g = true
[test_a11y_utility_tray_settings.py]
[test_a11y_utility_tray_visibility.py]
[test_a11y_volume_buttons.py]
[test_a11y_volume_buttons_panel_visibility.py]
@@ -0,0 +1,53 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import time

from gaiatest import GaiaTestCase
from gaiatest.apps.settings.app import Settings


class TestVolumeButtonsAccessibility(GaiaTestCase):

def setUp(self):
GaiaTestCase.setUp(self)

self.settings = Settings(self.marionette)
self.settings.launch()

def toggle_screen_reader(self):
self.marionette.switch_to_frame()

self.device.press_release_volume_up_then_down_n_times(3)
time.sleep(3)
self.device.press_release_volume_up_then_down_n_times(3)

self.apps.switch_to_displayed_app()

def test_a11y_volume_buttons(self):

# Panel should not be visible by default
self.assertFalse(self.data_layer.get_setting('accessibility.show-settings'))
self.assertFalse(self.is_element_displayed(
*self.settings._accessibility_menu_item_locator))
self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
*self.settings._accessibility_menu_item_locator)))

self.toggle_screen_reader()

# Panel should become visible after screen reader turned ON
self.assertTrue(self.data_layer.get_setting('accessibility.show-settings'))
self.assertTrue(self.is_element_displayed(
*self.settings._accessibility_menu_item_locator))
self.assertTrue(self.accessibility.is_visible(self.marionette.find_element(
*self.settings._accessibility_menu_item_locator)))

self.toggle_screen_reader()

# Panel should not be visible again
self.assertFalse(self.data_layer.get_setting('accessibility.show-settings'))
self.assertFalse(self.is_element_displayed(
*self.settings._accessibility_menu_item_locator))
self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
*self.settings._accessibility_menu_item_locator)))
Expand Up @@ -33,6 +33,7 @@ disabled = Bug 1022132 Intermittent Failure on TBPL
[accessibility/system/test_a11y_utility_tray_settings.py]
[accessibility/system/test_a11y_utility_tray_visibility.py]
[accessibility/system/test_a11y_volume_buttons.py]
[accessibility/system/test_a11y_volume_buttons_panel_visibility.py]

[functional/browser/test_browser_bookmark.py]
[functional/browser/test_browser_lan.py]
Expand Down

0 comments on commit 577efee

Please sign in to comment.