Chromium Code Reviews| Index: tools/accessibility/nvda/nvda_chrome_tests.py |
| diff --git a/tools/accessibility/nvda/nvda_chrome_tests.py b/tools/accessibility/nvda/nvda_chrome_tests.py |
| index 6cbfd1b30ee0b18b98baadaa4cbae5dde8c029c9..e6450905873d89ee4359009d2c6bce0c344e2c6f 100755 |
| --- a/tools/accessibility/nvda/nvda_chrome_tests.py |
| +++ b/tools/accessibility/nvda/nvda_chrome_tests.py |
| @@ -21,8 +21,8 @@ test script, then filing bugs for any potential failures. If the environment |
| is set up correctly, the actual tests should run automatically and unattended. |
| """ |
| + |
| import os |
| -import pywinauto |
| import re |
| import shutil |
| import signal |
| @@ -31,6 +31,7 @@ import sys |
| import tempfile |
| import time |
| import unittest |
| +import winapi |
|
dmazzoni
2014/11/01 06:45:13
I can't find the winapi module. Did you mean win32
|
| CHROME_PROFILES_PATH = os.path.join(os.getcwd(), 'chrome_profiles') |
| CHROME_PATH = os.path.join(os.environ['USERPROFILE'], |
| @@ -105,9 +106,7 @@ class NvdaChromeTest(unittest.TestCase): |
| sys.exit() |
| print 'NVDA pid: %d' % self._nvda_proc.pid |
| - app = pywinauto.application.Application() |
| - app.connect_(process = self._chrome_proc.pid) |
| - self._pywinauto_window = app.top_window_() |
| + winapi.focusWindow(self._chrome_proc.pid) |
|
dmazzoni
2014/11/01 06:45:13
I can't find the focusWindow function in win32api,
|
| try: |
| self._WaitForSpeech(['Address and search bar edit', 'about:blank']) |
| @@ -191,39 +190,52 @@ class NvdaChromeTest(unittest.TestCase): |
| def testTypingInOmnibox(self): |
| # Ctrl+A: Select all. |
| - self._pywinauto_window.TypeKeys('^A') |
| + winapi.typeKeys('{control}+a') |
| self._WaitForSpeech('selecting about:blank') |
| # Type three characters. |
| - self._pywinauto_window.TypeKeys('xyz') |
| + winapi.typeKeys('xyz') |
| self._WaitForSpeech(['x', 'y', 'z']) |
| # Arrow back over two characters. |
| - self._pywinauto_window.TypeKeys('{LEFT}') |
| + winapi.typeKeys('{left}') |
| self._WaitForSpeech(['z', 'z', 'unselecting']) |
| - self._pywinauto_window.TypeKeys('{LEFT}') |
| + winapi.typeKeys('{left}') |
| self._WaitForSpeech('y') |
| def testFocusToolbarButton(self): |
| # Alt+Shift+T. |
| - self._pywinauto_window.TypeKeys('%+T') |
| + winapi.typeKeys('{alt}+{shift}+t') |
| self._WaitForSpeech('Reload button Reload this page') |
| def testReadAllOnPageLoad(self): |
| # Ctrl+A: Select all |
| - self._pywinauto_window.TypeKeys('^A') |
| + winapi.typeKeys('{control}+a') |
| self._WaitForSpeech('selecting about:blank') |
| # Load data url. |
| - self._pywinauto_window.TypeKeys('data:text/html,Hello<p>World.') |
| + winapi.typeKeys('data:text/html,Hello<p>World.') |
| self._WaitForSpeech('dot') |
| - self._pywinauto_window.TypeKeys('{ENTER}') |
| + winapi.typeKeys('{enter}') |
| self._WaitForSpeech( |
| ['document', |
| 'Hello', |
| 'World.']) |
| +def testNavigatingByWord(self): |
| + winapi.typeKeys( |
| + 'data:text/html,<!DOCTYPE html><html><body>Word navigation</body></html>') |
|
dmazzoni
2014/11/01 06:45:13
You'll need an editable text field here for this t
|
| + self._WaitForSpeech('greater') |
| + winapi.typeKeys('{enter}') |
| + self._WaitForSpeech( |
| + ['document', |
| + 'Word navigation']) |
| + winapi.typeKeys('{control}+{right}') |
| + self._WaitForSpeech('navigation') |
| + winapi.typeKeys('{control}+{left}') |
| + self._WaitForSpeech('Word ') |
| + |
| if __name__ == '__main__': |
| unittest.main() |