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 |