| 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 factory test allows execution of a test-based script, with the | 8 # This factory test allows execution of a test-based script, with the |
| 9 # stdout of the script displayed in a the testing widget via gtk | 9 # stdout of the script displayed in a the testing widget via gtk |
| 10 # label. Keyboard input will be passed to the script via its stdin. | 10 # label. Keyboard input will be passed to the script via its stdin. |
| 11 | 11 |
| 12 import imp | 12 import imp |
| 13 import gobject | 13 import gobject |
| 14 import gtk | 14 import gtk |
| 15 import pango | 15 import pango |
| 16 import sys | 16 import sys |
| 17 import subprocess | 17 import subprocess |
| 18 | 18 |
| 19 from gtk import gdk | 19 from gtk import gdk |
| 20 | 20 |
| 21 from autotest_lib.client.bin import factory | 21 from autotest_lib.client.bin import factory |
| 22 from autotest_lib.client.bin import factory_ui_lib as ful | 22 from autotest_lib.client.bin import factory_ui_lib as ful |
| 23 from autotest_lib.client.bin import test | 23 from autotest_lib.client.bin import test |
| 24 from autotest_lib.client.common_lib import error | 24 from autotest_lib.client.bin import factory_error as error |
| 25 from autotest_lib.client.common_lib import pexpect | 25 from autotest_lib.client.common_lib import pexpect |
| 26 | 26 |
| 27 | 27 |
| 28 _MAX_LABEL_CHARS=256 | 28 _MAX_LABEL_CHARS=256 |
| 29 | 29 |
| 30 | 30 |
| 31 class Script: | 31 class Script: |
| 32 | 32 |
| 33 def __init__(self, cmdline, pexpect, label): | 33 def __init__(self, cmdline, pexpect, label): |
| 34 self._cmdline = cmdline | 34 self._cmdline = cmdline |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 test_widget = gtk.EventBox() | 82 test_widget = gtk.EventBox() |
| 83 test_widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) | 83 test_widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) |
| 84 test_widget.add(label) | 84 test_widget.add(label) |
| 85 | 85 |
| 86 self._script = Script(cmdline, pexpect, label) | 86 self._script = Script(cmdline, pexpect, label) |
| 87 | 87 |
| 88 ful.run_test_widget(self.job, test_widget, | 88 ful.run_test_widget(self.job, test_widget, |
| 89 window_registration_callback=self.register_callbacks) | 89 window_registration_callback=self.register_callbacks) |
| 90 | 90 |
| 91 factory.log('%s run_once finished' % self.__class__) | 91 factory.log('%s run_once finished' % self.__class__) |
| OLD | NEW |