summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional/chromeos_accessibility.py
diff options
context:
space:
mode:
authorrohitbm@chromium.org <rohitbm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 19:43:10 +0000
committerrohitbm@chromium.org <rohitbm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 19:43:10 +0000
commitbe2ec3bbd1fd8513113e9619a8b79d5b6906647c (patch)
tree8ba90b1bdc8d72f4535cec2b3cc0360001bbbf97 /chrome/test/functional/chromeos_accessibility.py
parent4287de8caaccca3a9f23fa1ae92f0675e0ccd020 (diff)
downloadchromium_src-be2ec3bbd1fd8513113e9619a8b79d5b6906647c.zip
chromium_src-be2ec3bbd1fd8513113e9619a8b79d5b6906647c.tar.gz
chromium_src-be2ec3bbd1fd8513113e9619a8b79d5b6906647c.tar.bz2
BUG=chromium-os:27414
Adding Accessibility automated tests to test login/logout, guest mode, performance and other various ChromeOS functionalities when Accessibility is enabled. Review URL: https://chromiumcodereview.appspot.com/9609022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional/chromeos_accessibility.py')
-rwxr-xr-xchrome/test/functional/chromeos_accessibility.py82
1 files changed, 79 insertions, 3 deletions
diff --git a/chrome/test/functional/chromeos_accessibility.py b/chrome/test/functional/chromeos_accessibility.py
index 274b420..d9f3297 100755
--- a/chrome/test/functional/chromeos_accessibility.py
+++ b/chrome/test/functional/chromeos_accessibility.py
@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
import os
import subprocess
@@ -11,15 +12,90 @@ import pyauto
class AccessibilityTest(pyauto.PyUITest):
- """Tests for Accessibility. """
+ """Tests for Accessibility.
- def testCanEnableSpokenFeedback(self):
- """Tests that spoken feedback accessibility mode can be enabled."""
+ Test various chromeos functionalities while Accessibility is turned on.
+ """
+ find_test_data_dir = 'find_in_page'
+
+ def setUp(self):
+ # We want a clean session_manager instance for every run,
+ # so restart session_manager now.
+ assert self.WaitForSessionManagerRestart(
+ lambda: subprocess.call(['pkill', 'session_manager'])), \
+ 'Timed out waiting for session_manager to start.'
+ pyauto.PyUITest.setUp(self)
+
+ def tearDown(self):
+ self._DisableSpokenFeedback()
+ pyauto.PyUITest.tearDown(self)
+
+ def _Login(self):
+ """Perform login."""
+ credentials = self.GetPrivateInfo()['test_google_account']
+ self.Login(credentials['username'], credentials['password'])
+ logging.info('Logging in as %s' % credentials['username'])
+ login_info = self.GetLoginInfo()
+ self.assertTrue(login_info['is_logged_in'], msg='Login failed.')
+
+ def _LoginWithSpokenFeedback(self):
+ self.EnableSpokenFeedback(True)
+ self._Login()
+ self.assertTrue(self.IsSpokenFeedbackEnabled(),
+ msg='Could not enable spoken feedback accessibility mode.')
+ def _EnableSpokenFeedback(self):
self.EnableSpokenFeedback(True)
self.assertTrue(self.IsSpokenFeedbackEnabled(),
msg='Could not enable spoken feedback accessibility mode.')
+ def _DisableSpokenFeedback(self):
+ self.EnableSpokenFeedback(False)
+ self.assertFalse(self.IsSpokenFeedbackEnabled(),
+ msg='Could not disable spoken feedback accessibility mode.')
+
+ def testCanEnableSpokenFeedback(self):
+ """Tests that spoken feedback accessibility mode can be enabled."""
+ self._EnableSpokenFeedback()
+
+ def testLoginAsGuest(self):
+ """Test that Guest user login is possible when Accessibility is on."""
+ self._EnableSpokenFeedback()
+ self.LoginAsGuest()
+ login_info = self.GetLoginInfo()
+ self.assertTrue(login_info['is_logged_in'], msg='Not logged in at all.')
+ self.assertTrue(login_info['is_guest'], msg='Not logged in as guest.')
+ url = self.GetFileURLForDataPath('title1.html')
+ self.NavigateToURL(url)
+ self.assertEqual(1, self.FindInPage('title')['match_count'],
+ msg='Failed to load the page or find the page contents.')
+
+ def testAccessibilityBeforeLogin(self):
+ """Test Accessibility before login."""
+ self._LoginWithSpokenFeedback()
+ self.Logout()
+ self.assertFalse(self.GetLoginInfo()['is_logged_in'],
+ msg='Still logged in when we should be logged out.')
+ self.assertTrue(self.IsSpokenFeedbackEnabled(),
+ msg='Spoken feedback accessibility mode disabled after loggin out.')
+ # For successive tests
+ self._Login()
+
+ def testAccessibilityAfterLogin(self):
+ """Test Accessibility after login."""
+ self._Login()
+ self._EnableSpokenFeedback()
+
+ def testPagePerformance(self):
+ """Test Chrome works fine when Accessibility is on."""
+ self._LoginWithSpokenFeedback()
+ # Verify that opened tab page behaves normally when Spoken Feedback is
+ # enabled. crosbug.com/26731
+ url = self.GetFileURLForDataPath(self.find_test_data_dir, 'largepage.html')
+ self.NavigateToURL(url)
+ self.assertEqual(373, self.FindInPage('daughter of Prince')['match_count'],
+ msg='Failed to load the page or find the page contents.')
+
if __name__ == '__main__':
pyauto_functional.Main()