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

Unified Diff: chrome/test/functional/perf.py

Issue 8869001: Adding new pyauto perf test for an HTML5 benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk (required minor edit). Created 9 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/perf.py
diff --git a/chrome/test/functional/perf.py b/chrome/test/functional/perf.py
index 0485057a772a1b07f316f7b5611bf74d9e19d926..1cd5764cd680b6ccceb554693fe814120ec9e3c8 100755
--- a/chrome/test/functional/perf.py
+++ b/chrome/test/functional/perf.py
@@ -782,6 +782,40 @@ class WebGLTest(BasePerfTest):
'WebGLSpaceRocks')
+class HTML5BenchmarkTest(BasePerfTest):
+ """Tests for HTML5 performance."""
+
+ def testHTML5Benchmark(self):
+ """Measures performance using the benchmark at html5-benchmark.com."""
+ self.NavigateToURL('http://html5-benchmark.com')
+
+ start_benchmark_js = """
+ benchmark();
+ window.domAutomationController.send("done");
+ """
+ self.ExecuteJavascript(start_benchmark_js)
+
+ js_final_score = """
+ var score = "-1";
+ var elem = document.getElementById("score");
+ if (elem)
+ score = elem.innerHTML;
+ window.domAutomationController.send(score);
+ """
+ # Wait for the benchmark to complete, which is assumed to be when the value
+ # of the 'score' DOM element changes to something other than '87485'.
+ self.assertTrue(
+ self.WaitUntil(
+ lambda: self.ExecuteJavascript(js_final_score) != '87485',
+ timeout=900, retry_sleep=1),
+ msg='Timed out when waiting for final score to be available.')
+
+ score = self.ExecuteJavascript(js_final_score)
+ logging.info('HTML5 Benchmark final score: %.2f' % float(score))
+ self._OutputPerfGraphValue('HTML5Benchmark', float(score), 'score',
+ graph_name='HTML5Benchmark')
+
+
class FileUploadDownloadTest(BasePerfTest):
"""Tests that involve measuring performance of upload and download."""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698