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

Unified Diff: client/common_lib/factory_test.py

Issue 2857012: Batched update of factory tests. (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: finished comment 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
« no previous file with comments | « no previous file | client/deps/factory/startx.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/common_lib/factory_test.py
diff --git a/client/common_lib/factory_test.py b/client/common_lib/factory_test.py
index 988d1b12fe16bdba2a735f5015336263b666a718..e356f01bd29a3905e7524fc687df74f846a00947 100644
--- a/client/common_lib/factory_test.py
+++ b/client/common_lib/factory_test.py
@@ -20,7 +20,7 @@ import sys
def XXX_log(s):
- print >> sys.stderr, '--- XXX : ' + s
+ print >> sys.stderr, 'FACTORY: ' + s
_BLACK = gtk.gdk.color_parse('black')
@@ -50,9 +50,11 @@ def test_switch_on_trigger(event):
def run_test_widget(test_widget=None, test_widget_size=None,
- window_registration_callback=None):
+ invisible_cursor=True,
+ window_registration_callback=None,
+ cleanup_callback=None):
+
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
- window.connect('destroy', lambda _: gtk.main_quit())
window.modify_bg(gtk.STATE_NORMAL, _BLACK)
window.set_size_request(*test_widget_size)
@@ -65,11 +67,11 @@ def run_test_widget(test_widget=None, test_widget_size=None,
gtk.gdk.pointer_grab(window.window, confine_to=window.window)
gtk.gdk.keyboard_grab(window.window)
- # create and use an invisible cursor
- pixmap = gtk.gdk.Pixmap(None, 1, 1, 1)
- color = gtk.gdk.Color()
- cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0)
- window.window.set_cursor(cursor)
+ if invisible_cursor:
+ pixmap = gtk.gdk.Pixmap(None, 1, 1, 1)
+ color = gtk.gdk.Color()
+ cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0)
+ window.window.set_cursor(cursor)
if window_registration_callback is not None:
window_registration_callback(window)
@@ -78,6 +80,9 @@ def run_test_widget(test_widget=None, test_widget_size=None,
gtk.main()
XXX_log('factory_test quit gtk.main')
+ if cleanup_callback is not None:
+ cleanup_callback()
+
gtk.gdk.pointer_ungrab()
gtk.gdk.keyboard_ungrab()
« no previous file with comments | « no previous file | client/deps/factory/startx.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698