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

Commit

Permalink
Revert "Merge pull request #20158 from yzen/bug-1018214"
Browse files Browse the repository at this point in the history
This reverts commit fe4842a, reversing
changes made to ac161f0.
  • Loading branch information
KevinGrandon committed Jun 13, 2014
1 parent 526d768 commit 259f517
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 160 deletions.
43 changes: 16 additions & 27 deletions tests/atoms/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
'use strict';

var Accessibility = {

_accRetrieval: SpecialPowers.Cc[
"@mozilla.org/accessibleRetrieval;1"].getService(
SpecialPowers.Ci.nsIAccessibleRetrieval),

_getAccessible:
function Accessibility__getAccessible(element, callback, once) {
let acc = this._accRetrieval.getAccessibleFor(element);
if (acc || once) {
_getAccessible: function Accessibility__getAccessible(element, callback) {
let gAccRetrieval = SpecialPowers.Cc[
"@mozilla.org/accessibleRetrieval;1"].getService(
SpecialPowers.Ci.nsIAccessibleRetrieval);
let attempts = 0;
let intervalId = setInterval(function() {
let acc = gAccRetrieval.getAccessibleFor(element);
if (acc || ++attempts > 10) {
clearInterval(intervalId);
callback(acc);
} else {
setTimeout(this._getAccessible.bind(this), 10, element, callback);
}
},
}, 10);
},

_matchState: function Accessibility__matchState(acc, stateName) {
let stateToMatch = SpecialPowers.wrap(
Expand All @@ -36,19 +35,6 @@ var Accessibility = {
});
},

wheel: function Accessibility_wheel(element, direction) {
let horizontal = direction === "left" || direction === "right";
let page = (direction === "left" || direction === "up") ? 1 : -1;
let event = new window.wrappedJSObject.WheelEvent('wheel', {
bubbles: true,
cancelable: true,
deltaX: horizontal ? page : 0,
deltaY: horizontal ? 0 : page,
deltaMode: window.wrappedJSObject.WheelEvent.DOM_DELTA_PAGE,
});
element.wrappedJSObject.dispatchEvent(event);
},

isDisabled: function Accessibility_isDisabled(element) {
this._getAccessible(element.wrappedJSObject, (acc) => {
this._matchState(acc, 'STATE_UNAVAILABLE');
Expand All @@ -72,7 +58,7 @@ var Accessibility = {
return;
}
this._matchState(acc, 'STATE_INVISIBLE');
}, true);
});
},

getName: function Accessibility_getName(element) {
Expand All @@ -83,7 +69,10 @@ var Accessibility = {

getRole: function Accessibility_getRole(element) {
this._getAccessible(element.wrappedJSObject, (acc) => {
marionetteScriptFinished(this._accRetrieval.getStringRole(acc.role));
let gAccRetrieval = SpecialPowers.Cc[
"@mozilla.org/accessibleRetrieval;1"].getService(
SpecialPowers.Ci.nsIAccessibleRetrieval);
marionetteScriptFinished(gAccRetrieval.getStringRole(acc.role));
});
},
};
1 change: 0 additions & 1 deletion tests/python/gaia-ui-tests/gaiatest/apps/system/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class System(Base):
_status_bar_notification_locator = (By.ID, 'statusbar-notification')
_geoloc_statusbar_locator = (By.ID, 'statusbar-geolocation')
_airplane_mode_statusbar_locator = (By.ID, 'statusbar-flight-mode')
_utility_tray_locator = (By.ID, 'utility-tray')

_notification_toaster_locator = (By.ID, 'notification-toaster')
_update_manager_toaster_locator = (By.ID, 'update-manager-toaster')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
from marionette.by import By
from gaiatest.apps.base import Base
from gaiatest.apps.base import PageRegion
from gaiatest.apps.settings.app import Settings
from gaiatest.apps.system.app import System


class UtilityTray(Base):
_notification_container_locator = (By.ID, 'notifications-container')
_desktop_notifications_locator = (By.CSS_SELECTOR, '#desktop-notifications-container .notification')
_notification_clear_locator = (By.ID, 'notification-clear')
_quicksettings_app_locator = (By.ID, 'quick-settings-full-app')
_grippy_locator = (By.ID, 'utility-tray-grippy')
_quick_settings_full_app_locator = (By.ID, 'quick-settings-full-app')

def wait_for_notification_container_displayed(self):
# Marionette cannot read the displayed state of the notification container so we wait for its location
Expand All @@ -29,23 +25,9 @@ def notifications(self):
def clear_all_notifications(self):
self.marionette.find_element(*self._notification_clear_locator).tap()

def a11y_clear_all_notifications(self):
self.accessibility.click(self.marionette.find_element(*self._notification_clear_locator))

def tap_settings_button(self):
self.marionette.find_element(*self._quicksettings_app_locator).tap()

def a11y_wheel_utility_tray_grippy(self):
self.accessibility.wheel(self.marionette.find_element(
*self._grippy_locator), 'up')
self.wait_for_element_not_displayed(*System(self.marionette)._utility_tray_locator)

def a11y_click_quick_settings_full_app(self):
self.accessibility.click(self.marionette.find_element(
*self._quick_settings_full_app_locator))
return Settings(self.marionette)


class Notification(PageRegion):
_body_locator = (By.CSS_SELECTOR, 'div.detail')
_title_locator = (By.CSS_SELECTOR, 'div.title')
Expand Down
4 changes: 0 additions & 4 deletions tests/python/gaia-ui-tests/gaiatest/gaia_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,6 @@ def click(self, element):
'Accessibility.click.apply(Accessibility, arguments)',
[element], special_powers=True)

def wheel(self, element, direction):
self.marionette.execute_script('Accessibility.wheel.apply(Accessibility, arguments)', [
element, direction])

def get_name(self, element):
return self.marionette.execute_async_script(
'return Accessibility.getName.apply(Accessibility, arguments)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
b2g = true

[test_a11y_notification_visibility.py]
[test_a11y_utility_tray_notifications.py]
[test_a11y_utility_tray_settings.py]
[test_a11y_utility_tray_visibility.py]
[test_a11y_volume_buttons.py]

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/python/gaia-ui-tests/gaiatest/tests/tbpl-manifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ disabled = Bug 1022132 Intermittent Failure on TBPL
[accessibility/phone/test_a11y_phone_keypad.py]
[accessibility/phone/test_a11y_phone_select_toolbars.py]
[accessibility/system/test_a11y_notification_visibility.py]
[accessibility/system/test_a11y_utility_tray_notifications.py]
[accessibility/system/test_a11y_utility_tray_settings.py]
[accessibility/system/test_a11y_utility_tray_visibility.py]
[accessibility/system/test_a11y_volume_buttons.py]

[functional/calendar/test_calendar_flick_through_months.py]
Expand Down

0 comments on commit 259f517

Please sign in to comment.