OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 # DESCRIPTION : | 6 # DESCRIPTION : |
7 # | 7 # |
8 # This is an example factory test that does not really do anything -- | 8 # This is an example factory test that does not really do anything -- |
9 # it displays a message in the center of the testing area, as | 9 # it displays a message in the center of the testing area, as |
10 # communicated by arguments to run_once(). This test makes use of the | 10 # communicated by arguments to run_once(). This test makes use of the |
11 # factory_ui_lib library to display its UI, and to monitor keyboard | 11 # factory_ui_lib library to display its UI, and to monitor keyboard |
12 # events for test-switching triggers. This test can be terminated by | 12 # events for test-switching triggers. This test can be terminated by |
13 # typing SHIFT-Q. | 13 # typing SHIFT-Q. |
14 | 14 |
15 | 15 |
16 import gtk | 16 import gtk |
17 import pango | 17 import pango |
18 import sys | 18 import sys |
19 | 19 |
20 from gtk import gdk | 20 from gtk import gdk |
21 | 21 |
22 from autotest_lib.client.bin import factory | 22 from autotest_lib.client.bin import factory |
23 from autotest_lib.client.bin import factory_ui_lib as ful | 23 from autotest_lib.client.bin import factory_ui_lib as ful |
24 from autotest_lib.client.bin import test | 24 from autotest_lib.client.bin import test |
25 from autotest_lib.client.common_lib import error | 25 from autotest_lib.client.bin import factory_error as error |
26 | 26 |
27 | 27 |
28 class factory_Dummy(test.test): | 28 class factory_Dummy(test.test): |
29 version = 1 | 29 version = 1 |
30 | 30 |
31 def key_release_callback(self, widget, event): | 31 def key_release_callback(self, widget, event): |
32 char = event.keyval in range(32,127) and chr(event.keyval) or None | 32 char = event.keyval in range(32,127) and chr(event.keyval) or None |
33 factory.log('key_release %s(%s)' % (event.keyval, char)) | 33 factory.log('key_release %s(%s)' % (event.keyval, char)) |
34 if event.keyval == self._quit_key: | 34 if event.keyval == self._quit_key: |
35 gtk.main_quit() | 35 gtk.main_quit() |
(...skipping 14 matching lines...) Expand all Loading... |
50 label = ful.make_label(msg) | 50 label = ful.make_label(msg) |
51 | 51 |
52 test_widget = gtk.EventBox() | 52 test_widget = gtk.EventBox() |
53 test_widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) | 53 test_widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) |
54 test_widget.add(label) | 54 test_widget.add(label) |
55 | 55 |
56 ful.run_test_widget(self.job, test_widget, | 56 ful.run_test_widget(self.job, test_widget, |
57 window_registration_callback=self.register_callbacks) | 57 window_registration_callback=self.register_callbacks) |
58 | 58 |
59 factory.log('%s run_once finished' % repr(self.__class__)) | 59 factory.log('%s run_once finished' % repr(self.__class__)) |
OLD | NEW |