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

Side by Side Diff: telemetry/telemetry/benchmark_unittest.py

Issue 2843403005: [Telemetry] Add Expectation module that enables disabling benchmarks/stories (Closed)
Patch Set: 30 -> 50 Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import optparse 5 import optparse
6 import unittest 6 import unittest
7 7
8 from telemetry import android 8 from telemetry import android
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.testing import options_for_unittests 10 from telemetry.testing import options_for_unittests
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 parser = optparse.OptionParser() 152 parser = optparse.OptionParser()
153 benchmark.AddCommandLineArgs(parser) 153 benchmark.AddCommandLineArgs(parser)
154 options.MergeDefaultValues(parser.get_default_values()) 154 options.MergeDefaultValues(parser.get_default_values())
155 155
156 b = PredicateBenchmark(page.Page(url='about:blank')) 156 b = PredicateBenchmark(page.Page(url='about:blank'))
157 b.Run(options) 157 b.Run(options)
158 finally: 158 finally:
159 story_runner.Run = original_run_fn 159 story_runner.Run = original_run_fn
160 160
161 self.assertTrue(validPredicate[0]) 161 self.assertTrue(validPredicate[0])
162
163 def testBenchmarkExpectations(self):
164 b = TestBenchmark(story_module.Story(
165 shared_state_class=shared_page_state.SharedPageState))
166 expectations = b.GetExpectations()
167 self.assertIsInstance(
168 expectations, story_module.expectations.StoryExpectations)
charliea (OOO until 10-5) 2017/05/15 21:15:41 possible suggestion: just inline b.GetExpectations
rnephew (Reviews Here) 2017/05/15 21:36:06 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698