| 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 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 window.connect('key-press-event', self.key_press_event) | 123 window.connect('key-press-event', self.key_press_event) |
| 124 window.connect('key-release-event', self.key_release_event) | 124 window.connect('key-release-event', self.key_release_event) |
| 125 window.add_events(gdk.KEY_PRESS_MASK | gdk.KEY_RELEASE_MASK) | 125 window.add_events(gdk.KEY_PRESS_MASK | gdk.KEY_RELEASE_MASK) |
| 126 | 126 |
| 127 | 127 |
| 128 class factory_Keyboard(test.test): | 128 class factory_Keyboard(test.test): |
| 129 version = 1 | 129 version = 1 |
| 130 preserve_srcdir = True | 130 preserve_srcdir = True |
| 131 | 131 |
| 132 def get_layout_from_vpd(self): | 132 def get_layout_from_vpd(self): |
| 133 """ vpd should contain "initial_locale"="en-US" or similar. """ | 133 """ vpd should contain |
| 134 "initial_locale"="en-US" |
| 135 "keyboard_layout"="xkb:us::eng" |
| 136 or similar. """ |
| 134 cmd = 'vpd -l | grep initial_locale | cut -f4 -d\'"\'' | 137 cmd = 'vpd -l | grep initial_locale | cut -f4 -d\'"\'' |
| 135 layout = utils.system_output(cmd).strip() | 138 layout = utils.system_output(cmd).strip() |
| 136 if layout != '': | 139 if layout != '': |
| 137 return layout | 140 return layout |
| 138 return None | 141 return None |
| 139 | 142 |
| 140 def run_once(self, layout=None): | 143 def run_once(self, layout=None): |
| 141 | 144 |
| 142 factory.log('%s run_once' % self.__class__) | 145 factory.log('%s run_once' % self.__class__) |
| 143 | 146 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 test_widget.pack_start(countdown_widget, False, False) | 184 test_widget.pack_start(countdown_widget, False, False) |
| 182 | 185 |
| 183 ful.run_test_widget(self.job, test_widget, | 186 ful.run_test_widget(self.job, test_widget, |
| 184 window_registration_callback=test.register_callbacks) | 187 window_registration_callback=test.register_callbacks) |
| 185 | 188 |
| 186 missing = test.calc_missing_string() | 189 missing = test.calc_missing_string() |
| 187 if missing: | 190 if missing: |
| 188 raise error.TestFail(missing) | 191 raise error.TestFail(missing) |
| 189 | 192 |
| 190 factory.log('%s run_once finished' % self.__class__) | 193 factory.log('%s run_once finished' % self.__class__) |
| OLD | NEW |