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 json | 5 import json |
6 import math | 6 import math |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import StringIO | 9 import StringIO |
10 import sys | 10 import sys |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 shutil.rmtree(tmp_path) | 1217 shutil.rmtree(tmp_path) |
1218 | 1218 |
1219 def testRunBenchmarkDisabledStoryWithBadName(self): | 1219 def testRunBenchmarkDisabledStoryWithBadName(self): |
1220 fake_benchmark = FakeBenchmark() | 1220 fake_benchmark = FakeBenchmark() |
1221 fake_benchmark.story_disabled = True | 1221 fake_benchmark.story_disabled = True |
1222 options = self._GenerateBaseBrowserFinderOptions() | 1222 options = self._GenerateBaseBrowserFinderOptions() |
1223 tmp_path = tempfile.mkdtemp() | 1223 tmp_path = tempfile.mkdtemp() |
1224 try: | 1224 try: |
1225 options.output_dir = tmp_path | 1225 options.output_dir = tmp_path |
1226 rc = story_runner.RunBenchmark(fake_benchmark, options) | 1226 rc = story_runner.RunBenchmark(fake_benchmark, options) |
1227 # The exception from not having a matching name is caught and the return | 1227 # Test should return 0 since only error messages are logged. |
1228 # code is set to a failure code. | 1228 self.assertEqual(rc, 0) |
1229 self.assertEqual(rc, 255) | |
1230 finally: | 1229 finally: |
1231 shutil.rmtree(tmp_path) | 1230 shutil.rmtree(tmp_path) |
OLD | NEW |