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

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

Issue 1972001: graphics_WindowManagerGraphicsCapture test taking screenshots and comparing them to reference images (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: comment fixes Created 10 years, 8 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/graphics_WindowManagerGraphicsCapture/graphics_WindowManagerGraphicsCapture.py
diff --git a/client/site_tests/graphics_WindowManagerGraphicsCapture/graphics_WindowManagerGraphicsCapture.py b/client/site_tests/graphics_WindowManagerGraphicsCapture/graphics_WindowManagerGraphicsCapture.py
index 77c9ce603531897bd8737737ffc4bf82f34d8868..b87a7dc6985a8fb8523d6313b7e64f1913135522 100644
--- a/client/site_tests/graphics_WindowManagerGraphicsCapture/graphics_WindowManagerGraphicsCapture.py
+++ b/client/site_tests/graphics_WindowManagerGraphicsCapture/graphics_WindowManagerGraphicsCapture.py
@@ -18,14 +18,42 @@ class graphics_WindowManagerGraphicsCapture(site_ui_test.UITest):
dep = 'glbench'
dep_dir = os.path.join(self.autodir, 'deps', dep)
self.job.install_pkg(dep, 'dep', dep_dir)
-
+
+ screenshot1_reference = os.path.join(self.bindir,
+ "screenshot1_reference")
+ screenshot1_generated = os.path.join(self.resultsdir,
+ "screenshot1_generated")
+ screenshot1_resized = os.path.join(self.resultsdir,
+ "screenshot1_generated_resized")
+ screenshot2_reference = os.path.join(self.bindir,
+ "screenshot2_reference")
+ screenshot2_generated = os.path.join(self.resultsdir,
+ "screenshot2_generated")
+ screenshot2_resized = os.path.join(self.resultsdir,
+ "screenshot2_generated_resized")
+
exefile = os.path.join(self.autodir, 'deps/glbench/windowmanagertest')
-
# Enable running in window manager
exefile = ('chvt 1 && DISPLAY=:0 XAUTHORITY=/home/chronos/.Xauthority '
+ exefile)
- options = "--seconds_to_run 10"
- cmd = "%s %s" % (exefile, options)
- logging.info("command launched: %s" % cmd)
- self.results = utils.system_output(cmd, retain_output=True)
+ # Delay before screenshot: 1 second has caused failures
+ options = ' --screenshot1_sec 2'
+ options += ' --screenshot2_sec 1'
+ options += ' --cooldown_sec 1'
+ options += ' --screenshot1_cmd "screenshot %s"' % screenshot1_generated
+ options += ' --screenshot2_cmd "screenshot %s"' % screenshot2_generated
+
+ utils.system(exefile + " " + options)
+
+ utils.system("convert -resize '100x100!' %s %s" %
+ (screenshot1_generated, screenshot1_resized))
+ utils.system("convert -resize '100x100!' %s %s" %
+ (screenshot2_generated, screenshot2_resized))
+ os.remove(screenshot1_generated)
+ os.remove(screenshot2_generated)
+
+ utils.system("perceptualdiff -verbose %s %s"
+ % (screenshot1_reference, screenshot1_resized))
+ utils.system("perceptualdiff -verbose %s %s"
+ % (screenshot2_reference, screenshot2_resized))

Powered by Google App Engine
This is Rietveld 408576698