OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # | 2 # |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 | 7 |
8 # DESCRIPTION : | 8 # DESCRIPTION : |
9 # | 9 # |
10 # Intended for use during manufacturing to validate that all keyboard | 10 # Intended for use during manufacturing to validate that all keyboard |
11 # keys function properly. This program will display a keyboard image | 11 # keys function properly. This program will display a keyboard image |
12 # and keys will be highlighted as they are pressed and released. | 12 # and keys will be highlighted as they are pressed and released. |
13 # After the first key is hit, a countdown will begin. If not all keys | 13 # After the first key is hit, a countdown will begin. If not all keys |
14 # are used in time, the test will fail. | 14 # are used in time, the test will fail. |
15 | 15 |
16 | 16 |
17 import cairo | 17 import cairo |
18 import gobject | 18 import gobject |
19 import gtk | 19 import gtk |
20 import logging | 20 import logging |
21 import time | 21 import time |
22 import os | 22 import os |
23 import sys | 23 import sys |
24 | 24 |
25 from gtk import gdk | 25 from gtk import gdk |
26 | 26 |
27 from autotest_lib.client.bin import factory | 27 from autotest_lib.client.bin import factory |
28 from autotest_lib.client.bin import factory_ui_lib as ful | 28 from autotest_lib.client.bin import factory_ui_lib as ful |
29 from autotest_lib.client.bin import test | 29 from autotest_lib.client.bin import test |
30 from autotest_lib.client.common_lib import error | 30 from autotest_lib.client.bin import factory_error as error |
31 | 31 |
32 | 32 |
33 class KeyboardTest: | 33 class KeyboardTest: |
34 | 34 |
35 def __init__(self, kbd_image, bindings): | 35 def __init__(self, kbd_image, bindings): |
36 self._kbd_image = kbd_image | 36 self._kbd_image = kbd_image |
37 self._bindings = bindings | 37 self._bindings = bindings |
38 self._pressed_keys = set() | 38 self._pressed_keys = set() |
39 self._deadline = None | 39 self._deadline = None |
40 self.successful_keys = set() | 40 self.successful_keys = set() |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 test_widget.pack_start(countdown_widget, False, False) | 164 test_widget.pack_start(countdown_widget, False, False) |
165 | 165 |
166 ful.run_test_widget(self.job, test_widget, | 166 ful.run_test_widget(self.job, test_widget, |
167 window_registration_callback=test.register_callbacks) | 167 window_registration_callback=test.register_callbacks) |
168 | 168 |
169 missing = test.calc_missing_string() | 169 missing = test.calc_missing_string() |
170 if missing: | 170 if missing: |
171 raise error.TestFail(missing) | 171 raise error.TestFail(missing) |
172 | 172 |
173 factory.log('%s run_once finished' % self.__class__) | 173 factory.log('%s run_once finished' % self.__class__) |
OLD | NEW |