Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: client/site_tests/factory_Dummy/factory_Dummy.py

Issue 2836043: Relocate library files for wider access and re-use; also associated cleanup. (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: patch typo Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/site_tests/factory_Dummy/factory_Dummy.py
diff --git a/client/site_tests/factory_Dummy/factory_Dummy.py b/client/site_tests/factory_Dummy/factory_Dummy.py
index 07d1574f82d796b4b83eb7eeb7eb7db85f2d717b..49130e31e00e6d29d701e674b46f6c179bd02151 100644
--- a/client/site_tests/factory_Dummy/factory_Dummy.py
+++ b/client/site_tests/factory_Dummy/factory_Dummy.py
@@ -8,45 +8,50 @@
# This is an example factory test that does not really do anything --
# it displays a message in the center of the testing area, as
# communicated by arguments to run_once(). This test makes use of the
-# factory_test library to display its UI, and to monitor keyboard
+# factory_ui_lib library to display its UI, and to monitor keyboard
# events for test-switching triggers. This test can be terminated by
# typing SHIFT-Q.
-from autotest_lib.client.bin import test
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.common_lib import factory_test
import gtk
import pango
import sys
+from autotest_lib.client.bin import factory
+from autotest_lib.client.bin import factory_ui_lib as ful
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import error
+
class factory_Dummy(test.test):
version = 1
def key_release_callback(self, widget, event):
char = event.keyval in range(32,127) and chr(event.keyval) or None
- factory_test.XXX_log('key_release_callback %s(%s)' %
- (event.keyval, char))
- if event.keyval == self.quit_key:
- factory_test.XXX_log('factory_Dummy exiting...')
+ factory.log('key_release_callback %s(%s)' % (event.keyval, char))
+ if event.keyval == self._quit_key:
gtk.main_quit()
- factory_test.test_switch_on_trigger(event)
+ self._ft_state.exit_on_trigger(event)
return True
def register_callbacks(self, window):
window.connect('key-release-event', self.key_release_callback)
window.add_events(gtk.gdk.KEY_RELEASE_MASK)
- def run_once(self, test_widget_size=None, trigger_set=None,
- result_file_path=None, quit_key=ord('Q'), msg='factory_Dummy'):
+ def run_once(self,
+ test_widget_size=None,
+ trigger_set=None,
+ result_file_path=None,
+ quit_key=ord('Q'),
+ msg='factory_Dummy'):
- factory_test.XXX_log('factory_Dummy')
+ factory.log('%s run_once' % self.__class__)
- self.quit_key = quit_key
+ self._quit_key = quit_key
- factory_test.init(trigger_set=trigger_set,
- result_file_path=result_file_path)
+ self._ft_state = ful.State(
+ trigger_set=trigger_set,
+ result_file_path=result_file_path)
label = gtk.Label(msg)
label.modify_font(pango.FontDescription('courier new condensed 20'))
@@ -57,9 +62,9 @@ class factory_Dummy(test.test):
test_widget.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black'))
test_widget.add(label)
- factory_test.run_test_widget(
+ self._ft_state.run_test_widget(
test_widget=test_widget,
test_widget_size=test_widget_size,
window_registration_callback=self.register_callbacks)
- factory_test.XXX_log('exiting factory_Dummy')
+ factory.log('%s run_once finished' % self.__class__)

Powered by Google App Engine
This is Rietveld 408576698