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

Unified Diff: tools/telemetry/telemetry/unittest/run_tests.py

Issue 461043003: Implement --browser=<perf trybot> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with dependent CLS Created 6 years, 4 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: tools/telemetry/telemetry/unittest/run_tests.py
diff --git a/tools/telemetry/telemetry/unittest/run_tests.py b/tools/telemetry/telemetry/unittest/run_tests.py
index 92c2c336d826f75e26680660317e7f91b92515f7..1223e33d9dc97352aa973cf5e80259dd6d3f54cc 100644
--- a/tools/telemetry/telemetry/unittest/run_tests.py
+++ b/tools/telemetry/telemetry/unittest/run_tests.py
@@ -2,8 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import json
import logging
+import StringIO
import unittest
+import urllib2
from telemetry import decorators
from telemetry.core import browser_finder
@@ -110,6 +113,16 @@ def RestoreLoggingLevel(func):
config = None
+# pylint: disable=W0613
+def stuburlopen(url):
+ assert not hasattr(stuburlopen, 'called')
+ setattr(stuburlopen, 'called', 1)
+ return StringIO.StringIO(json.dumps({'builders':{
+ 'android_nexus4_perf_bisect': 'stuff',
+ 'mac_10_9_perf_bisect': 'otherstuff',
+ 'win_perf_bisect_builder': 'not a trybot',
+ }}))
+
class RunTestsCommand(command_line.OptparseCommand):
"""Run unit tests"""
@@ -205,4 +218,5 @@ class RunTestsCommand(command_line.OptparseCommand):
@classmethod
@RestoreLoggingLevel
def main(cls, args=None):
+ urllib2.urlopen = stuburlopen
return super(RunTestsCommand, cls).main(args)
sullivan 2014/08/15 14:58:37 There's one big problem with this CL: the unit tes

Powered by Google App Engine
This is Rietveld 408576698