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

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: Increased timeout since this benchmark can be really slow on ChromeOS. 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 e75faba04bf779fb1880ca44b1d8cd526c5db21d..cdf4158b2229a48fa7bb06444d4910477b720b3f 100755
--- a/chrome/test/functional/perf.py
+++ b/chrome/test/functional/perf.py
@@ -751,6 +751,39 @@ class WebGLTest(BasePerfTest):
'WebGLSpaceRocks')
+class HTML5Test(BasePerfTest):
Nirnimesh 2011/12/07 22:55:22 Change name to HTML5BenchmarkTest
dennis_jeffrey 2011/12/07 23:04:46 Done.
+ """Tests for HTML5 performance."""
Nirnimesh 2011/12/07 22:55:22 It'd be nice to declare the URL here.
dennis_jeffrey 2011/12/07 23:04:46 Leaving alone as per offline discussion. The URL
+
+ 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('score_HTML5Benchmark', float(score))
+
+
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