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

Side by Side Diff: tools/perf/benchmarks/canvasmark.py

Issue 23455049: [telemetry] Make single-benchmark measurements protected and undiscoverable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update discover unit tests. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/benchmarks/blink_perf.py ('k') | tools/perf/benchmarks/dom_perf.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Runs Canvasmark HTML5, Canvas 2D rendering and javascript benchmark. 5 """Runs Canvasmark HTML5, Canvas 2D rendering and javascript benchmark.
6 6
7 CanvasMark tests the HTML5 <canvas> rendering performance for commonly used 7 CanvasMark tests the HTML5 <canvas> rendering performance for commonly used
8 operations in HTML5 games: bitmaps, canvas drawing, alpha blending, polygon 8 operations in HTML5 games: bitmaps, canvas drawing, alpha blending, polygon
9 fills, shadows and text functions. 9 fills, shadows and text functions.
10 """ 10 """
11 11
12 import os 12 import os
13 13
14 from telemetry import test 14 from telemetry import test
15 from telemetry.page import page_measurement 15 from telemetry.page import page_measurement
16 from telemetry.page import page_set 16 from telemetry.page import page_set
17 17
18 class CanvasMarkMeasurement(page_measurement.PageMeasurement): 18 class _CanvasMarkMeasurement(page_measurement.PageMeasurement):
19 19
20 def WillNavigateToPage(self, page, tab): 20 def WillNavigateToPage(self, page, tab):
21 page.script_to_evaluate_on_commit = """ 21 page.script_to_evaluate_on_commit = """
22 var __results = []; 22 var __results = [];
23 var __real_log = window.console.log; 23 var __real_log = window.console.log;
24 window.console.log = function(msg) { 24 window.console.log = function(msg) {
25 __results.push(msg); 25 __results.push(msg);
26 __real_log.apply(this, [msg]); 26 __real_log.apply(this, [msg]);
27 } 27 }
28 """ 28 """
(...skipping 10 matching lines...) Expand all
39 'Unexpected result format "%s"' % score_and_name 39 'Unexpected result format "%s"' % score_and_name
40 score = int(score_and_name[0]) 40 score = int(score_and_name[0])
41 name = score_and_name[1][:-1] 41 name = score_and_name[1][:-1]
42 results.Add(name, 'score', score, data_type='unimportant') 42 results.Add(name, 'score', score, data_type='unimportant')
43 # Aggregate total score for all tests. 43 # Aggregate total score for all tests.
44 total += score 44 total += score
45 results.Add('Score', 'score', total) 45 results.Add('Score', 'score', total)
46 46
47 47
48 class CanvasMark(test.Test): 48 class CanvasMark(test.Test):
49 test = CanvasMarkMeasurement 49 test = _CanvasMarkMeasurement
50 50
51 def CreatePageSet(self, options): 51 def CreatePageSet(self, options):
52 return page_set.PageSet.FromDict({ 52 return page_set.PageSet.FromDict({
53 'archive_data_file': '../page_sets/data/canvasmark.json', 53 'archive_data_file': '../page_sets/data/canvasmark.json',
54 'make_javascript_deterministic': False, 54 'make_javascript_deterministic': False,
55 'pages': [ 55 'pages': [
56 { 'url': 56 { 'url':
57 'http://www.kevs3d.co.uk/dev/canvasmark/?auto=true'} 57 'http://www.kevs3d.co.uk/dev/canvasmark/?auto=true'}
58 ] 58 ]
59 }, os.path.abspath(__file__)) 59 }, os.path.abspath(__file__))
60 60
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/blink_perf.py ('k') | tools/perf/benchmarks/dom_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698