| OLD | NEW |
| 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 Loading... |
| 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.assertTrue( |
| 168 isinstance( |
| 169 expectations, story_module.expectations.StoryExpectations)) |
| OLD | NEW |