accerciser r426 - in trunk: . plugindata/validate



Author: parente
Date: Thu Jan 17 01:55:53 2008
New Revision: 426
URL: http://svn.gnome.org/viewvc/accerciser?rev=426&view=rev

Log:
2008-01-16  Peter Parente  <parente cs unc edu>

	* plugindata/validate/basic.py: Added comments



Modified:
   trunk/ChangeLog
   trunk/plugindata/validate/basic.py

Modified: trunk/plugindata/validate/basic.py
==============================================================================
--- trunk/plugindata/validate/basic.py	(original)
+++ trunk/plugindata/validate/basic.py	Thu Jan 17 01:55:53 2008
@@ -9,6 +9,10 @@
   'description': _('Tests fundamental GUI application accessibility')}
 
 class ActionIsInteractive(Validator):
+  '''
+  Any item that supports the action interface should also be focusable or 
+  selectable so the user may interact with it via the keyboard.
+  '''
   URL = 'http://live.gnome.org/Accerciser/Validate#1'
   def condition(self, acc):
     return acc.queryAction()
@@ -21,6 +25,10 @@
                  acc.getLocalizedRoleName(), acc, self.URL)
 
 class WidgetHasAction(Validator):
+  '''
+  Any widget with a role listed in condition should support the action 
+  interface.
+  '''
   URL = 'http://live.gnome.org/Accerciser/Validate#2'
   def condition(self, acc):
     return acc.getRole() in [ROLE_PUSH_BUTTON, ROLE_MENU, ROLE_MENU_ITEM,
@@ -35,6 +43,10 @@
                  acc.getLocalizedRoleName(), acc, self.URL)
 
 class OneFocus(Validator):  
+  '''
+  The application should have on and only one accessible with state focused
+  at any one time.
+  '''
   def before(self, acc, state, view):
     s = acc.getState()
     if s.contains(STATE_FOCUSED):
@@ -44,6 +56,10 @@
         view.error(_('more than one focused widget'), acc)
 
 class WidgetHasText(Validator):
+  '''
+  Any widget with a role listed in condition should support the text interface
+  since they all support stylized text.
+  '''
   def condition(self, acc):
     return acc.getRole() in [ROLE_PUSH_BUTTON, ROLE_MENU, ROLE_MENU_ITEM,
                              ROLE_CHECK_MENU_ITEM, ROLE_RADIO_MENU_ITEM,
@@ -65,6 +81,10 @@
       view.error(_('%s has no text interface') % acc.getLocalizedRoleName(), acc)
 
 class ParentChildIndexMatch(Validator):
+  '''
+  The index returned by acc.getIndexInParent should return acc when provided
+  to getChildAtIndex.
+  '''
   def condition(self, acc):
     # don't test applications
     acc.queryApplication()
@@ -81,6 +101,10 @@
                  acc.getLocalizedRoleName(), acc)
 
 class ReciprocalRelations(Validator):
+  '''
+  Any relation in the map should point to an accessible having the reciprocal
+  relation.
+  '''
   REL_MAP = {RELATION_LABEL_FOR : RELATION_LABELLED_BY,
              RELATION_CONTROLLER_FOR : RELATION_CONTROLLED_BY,
              RELATION_MEMBER_OF : RELATION_MEMBER_OF,
@@ -122,6 +146,10 @@
                      rel.getRelationTypeName(), acc)
     
 class HasLabelName(Validator):
+  '''
+  Any accessible with one of the roles listed below should have an accessible
+  name, a labelled by relationship, or both.
+  '''
   URL = 'http://live.gnome.org/Accerciser/Validate#4'
   TEXT_CANNOT_LABEL = [ROLE_SPIN_BUTTON, ROLE_SLIDER, ROLE_PASSWORD_TEXT,
                        ROLE_TEXT, ROLE_ENTRY, ROLE_TERMINAL]
@@ -167,6 +195,10 @@
                self.URL)
     
 class TableHasSelection(Validator):
+  '''
+  A focusable accessible with a table interface should also support the 
+  selection interface.
+  '''
   def condition(self, acc):
     acc.queryTable()
     return acc.getState().contains(STATE_FOCUSABLE)
@@ -179,6 +211,10 @@
                  acc.getLocalizedRoleName(), acc)
                  
 class StateWithAbility(Validator):
+  '''
+  Any accessible with one of the ephemeral states in state map should have the
+  corresponding -able state.
+  '''
   STATE_MAP = {STATE_EXPANDED : STATE_EXPANDABLE,
                STATE_COLLAPSED : STATE_EXPANDABLE,
                STATE_FOCUSED : STATE_FOCUSABLE,
@@ -200,6 +236,10 @@
         stateToString(able_state)), acc)
 
 class RadioInSet(Validator):
+  '''
+  An accessible with a radio button role should be a member of a set as 
+  indicated by a relation or appropriate object property.
+  '''
   def condition(self, acc):
     return self.getRole() in [ROLE_RADIO_BUTTON, ROLE_RADIO_MENU_ITEM]
 
@@ -225,6 +265,10 @@
   return r, c
     
 class TableRowColIndex(Validator):
+  '''
+  The index returned by getIndexAt(row, col) should result in getRowAtIndex
+  and getColumnAtIndex returning the original row and col.
+  '''
   MAX_SAMPLES = 100
   def condition(self, acc):
     t = acc.queryTable()
@@ -250,6 +294,10 @@
         return
 
 class TableRowColParentIndex(Validator):
+  '''
+  The accessible returned by table.getAccessibleAt should return 
+  acc.getIndexInParent matching acc.getIndexAt.
+  '''
   MAX_SAMPLES = 100
   def condition(self, acc):
     t = acc.queryTable()
@@ -276,6 +324,10 @@
         return
 
 class ImageHasName(Validator):
+  '''
+  Any accessible with an image role or image interface should have either a
+  name, description, or image description.
+  '''
   def condition(self, acc):
     if acc.getRole() in [ROLE_DESKTOP_ICON, ROLE_ICON, ROLE_ANIMATION,
                          ROLE_IMAGE]:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]