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

Unified Diff: tools/chrome_remote_control/examples/rendering_microbenchmark_test.py

Issue 11361165: [chrome_remote_control] Rename chrome_remote_control to telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/chrome_remote_control/examples/rendering_microbenchmark_test.py
diff --git a/tools/chrome_remote_control/examples/rendering_microbenchmark_test.py b/tools/chrome_remote_control/examples/rendering_microbenchmark_test.py
deleted file mode 100755
index 4dd26ed42f5ff0ae55b7ae62f3b105c04d1e9167..0000000000000000000000000000000000000000
--- a/tools/chrome_remote_control/examples/rendering_microbenchmark_test.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import os
-import re
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-
-import chrome_remote_control
-
-def Main(args):
- options = chrome_remote_control.BrowserOptions()
- parser = options.CreateParser('rendering_microbenchmark_test.py <sitelist>')
- # TODO(nduca): Add test specific options here, if any.
- options, args = parser.parse_args(args)
- if len(args) != 1:
- parser.print_usage()
- return 255
-
- urls = []
- with open(args[0], 'r') as f:
- for url in f.readlines():
- url = url.strip()
- if not re.match('(.+)://', url):
- url = 'http://%s' % url
- urls.append(url)
-
- options.extra_browser_args.append('--enable-gpu-benchmarking')
- browser_to_create = chrome_remote_control.FindBrowser(options)
- if not browser_to_create:
- sys.stderr.write('No browser found! Supported types: %s' %
- chrome_remote_control.GetAllAvailableBrowserTypes(options))
- return 255
- with browser_to_create.Create() as b:
- with b.ConnectToNthTab(0) as tab:
- # Check browser for benchmark API. Can only be done on non-chrome URLs.
- tab.page.Navigate('http://www.google.com')
- import time
- time.sleep(2)
- tab.WaitForDocumentReadyStateToBeComplete()
- if tab.runtime.Evaluate('window.chrome.gpuBenchmarking === undefined'):
- print 'Browser does not support gpu benchmarks API.'
- return 255
-
- if tab.runtime.Evaluate(
- 'window.chrome.gpuBenchmarking.runRenderingBenchmarks === undefined'):
- print 'Browser does not support rendering benchmarks API.'
- return 255
-
- # Run the test. :)
- first_line = []
- def DumpResults(url, results):
- if len(first_line) == 0:
- cols = ['url']
- for r in results:
- cols.append(r['benchmark'])
- print ','.join(cols)
- first_line.append(0)
- cols = [url]
- for r in results:
- cols.append(str(r['result']))
- print ','.join(cols)
-
- for u in urls:
- tab.page.Navigate(u)
- tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()
- results = tab.runtime.Evaluate(
- 'window.chrome.gpuBenchmarking.runRenderingBenchmarks();')
- DumpResults(url, results)
-
- return 0
-
-if __name__ == '__main__':
- sys.exit(Main(sys.argv[1:]))
« no previous file with comments | « tools/chrome_remote_control/examples/list_available_browsers ('k') | tools/chrome_remote_control/examples/top1k » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698