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

Unified Diff: tools/perf/benchmarks/benchmark_smoke_unittest.py

Issue 1152763002: Fix tab_switching measurement bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix benchmark_smoke_unittest failure because tab_switching failed to switch tab if there's only one… Created 5 years, 6 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
« no previous file with comments | « no previous file | tools/perf/measurements/tab_switching.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/benchmark_smoke_unittest.py
diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py
index 209e658badaa03b38f537c0784883d98da6297db..9925c0f17edd4230dc9e931d0e70ce51c3cc9d8e 100644
--- a/tools/perf/benchmarks/benchmark_smoke_unittest.py
+++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py
@@ -32,7 +32,8 @@ from benchmarks import speedometer
from benchmarks import jetstream
-def SmokeTestGenerator(benchmark):
+def SmokeTestGenerator(benchmark, num_pages=1):
+ """Generates a benchmark that includes first N pages from pageset."""
# NOTE TO SHERIFFS: DO NOT DISABLE THIS TEST.
#
# This smoke test dynamically tests all benchmarks. So disabling it for one
@@ -49,10 +50,11 @@ def SmokeTestGenerator(benchmark):
def CreatePageSet(self, options):
# pylint: disable=E1002
ps = super(SinglePageBenchmark, self).CreatePageSet(options)
- for p in ps.pages:
+ user_stories = []
+ for p in ps.pages[:num_pages]:
p.skip_waits = True
- ps.user_stories = [p]
- break
+ user_stories.append(p)
+ ps.user_stories = user_stories
return ps
# Set the benchmark's default arguments.
@@ -128,7 +130,11 @@ def load_tests(loader, standard_tests, pattern):
class BenchmarkSmokeTest(unittest.TestCase):
pass
- method = SmokeTestGenerator(benchmark)
+ # It is wrong to give tab_switching only one page to switch.
+ if 'tab_switching' in benchmark.Name():
+ method = SmokeTestGenerator(benchmark, num_pages=2)
nednguyen 2015/06/24 14:53:10 This fix is reasonable. But please check the cycle
+ else:
+ method = SmokeTestGenerator(benchmark)
# Make sure any decorators are propagated from the original declaration.
# (access to protected members) pylint: disable=W0212
« no previous file with comments | « no previous file | tools/perf/measurements/tab_switching.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698