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 os | 5 import os |
6 import re | 6 import re |
7 import shutil | 7 import shutil |
8 import sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 self.assertEqual( | 397 self.assertEqual( |
398 23634, source_control.GetCommitPosition(v8_rev, depot_path)) | 398 23634, source_control.GetCommitPosition(v8_rev, depot_path)) |
399 | 399 |
400 def testGetCommitPositionForWebKit(self): | 400 def testGetCommitPositionForWebKit(self): |
401 bisect_instance = _GetBisectPerformanceMetricsInstance(DEFAULT_OPTIONS) | 401 bisect_instance = _GetBisectPerformanceMetricsInstance(DEFAULT_OPTIONS) |
402 wk_rev = 'a94d028e0f2c77f159b3dac95eb90c3b4cf48c61' | 402 wk_rev = 'a94d028e0f2c77f159b3dac95eb90c3b4cf48c61' |
403 depot_path = os.path.join(bisect_instance.src_cwd, 'third_party', 'WebKit') | 403 depot_path = os.path.join(bisect_instance.src_cwd, 'third_party', 'WebKit') |
404 self.assertEqual( | 404 self.assertEqual( |
405 181660, source_control.GetCommitPosition(wk_rev, depot_path)) | 405 181660, source_control.GetCommitPosition(wk_rev, depot_path)) |
406 | 406 |
| 407 def testGetCommitPositionForSkia(self): |
| 408 bisect_instance = _GetBisectPerformanceMetricsInstance(DEFAULT_OPTIONS) |
| 409 skia_rev = 'a94d028e0f2c77f159b3dac95eb90c3b4cf48c61' |
| 410 depot_path = os.path.join(bisect_instance.src_cwd, 'third_party', 'skia') |
| 411 # Skia doesn't use commit positions, and GetCommitPosition should |
| 412 # return None for repos that don't use commit positions. |
| 413 self.assertIsNone(source_control.GetCommitPosition(skia_rev, depot_path)) |
| 414 |
407 def testUpdateDepsContent(self): | 415 def testUpdateDepsContent(self): |
408 bisect_instance = _GetBisectPerformanceMetricsInstance(DEFAULT_OPTIONS) | 416 bisect_instance = _GetBisectPerformanceMetricsInstance(DEFAULT_OPTIONS) |
409 deps_file = 'DEPS' | 417 deps_file = 'DEPS' |
410 # We are intentionally reading DEPS file contents instead of string literal | 418 # We are intentionally reading DEPS file contents instead of string literal |
411 # with few lines from DEPS because to check if the format we are expecting | 419 # with few lines from DEPS because to check if the format we are expecting |
412 # to search is not changed in DEPS content. | 420 # to search is not changed in DEPS content. |
413 # TODO (prasadv): Add a separate test to validate the DEPS contents with the | 421 # TODO (prasadv): Add a separate test to validate the DEPS contents with the |
414 # format that bisect script expects. | 422 # format that bisect script expects. |
415 deps_contents = bisect_perf_regression.ReadStringFromFile(deps_file) | 423 deps_contents = bisect_perf_regression.ReadStringFromFile(deps_file) |
416 deps_key = 'v8_revision' | 424 deps_key = 'v8_revision' |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 ], (None, 0)), | 612 ], (None, 0)), |
605 ] | 613 ] |
606 self._SetupRunGitMock(try_cmd) | 614 self._SetupRunGitMock(try_cmd) |
607 bisect_perf_regression._BuilderTryjob( | 615 bisect_perf_regression._BuilderTryjob( |
608 git_revision, bot_name, bisect_job_name, patch) | 616 git_revision, bot_name, bisect_job_name, patch) |
609 | 617 |
610 | 618 |
611 if __name__ == '__main__': | 619 if __name__ == '__main__': |
612 unittest.main() | 620 unittest.main() |
613 | 621 |
OLD | NEW |