| 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 StringIO | 6 import StringIO |
| 7 import sys | 7 import sys |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 from catapult_base import cloud_storage # pylint: disable=import-error | 10 from catapult_base import cloud_storage # pylint: disable=import-error |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 super(DummyLocalStory, self).__init__( | 104 super(DummyLocalStory, self).__init__( |
| 105 shared_state_class, name=name) | 105 shared_state_class, name=name) |
| 106 | 106 |
| 107 def Run(self, shared_state): | 107 def Run(self, shared_state): |
| 108 pass | 108 pass |
| 109 | 109 |
| 110 @property | 110 @property |
| 111 def is_local(self): | 111 def is_local(self): |
| 112 return True | 112 return True |
| 113 | 113 |
| 114 @property |
| 115 def url(self): |
| 116 return 'data:,' |
| 117 |
| 118 |
| 114 class MixedStateStorySet(story_module.StorySet): | 119 class MixedStateStorySet(story_module.StorySet): |
| 115 @property | 120 @property |
| 116 def allow_mixed_story_states(self): | 121 def allow_mixed_story_states(self): |
| 117 return True | 122 return True |
| 118 | 123 |
| 119 def SetupStorySet(allow_multiple_story_states, story_state_list): | 124 def SetupStorySet(allow_multiple_story_states, story_state_list): |
| 120 if allow_multiple_story_states: | 125 if allow_multiple_story_states: |
| 121 story_set = MixedStateStorySet() | 126 story_set = MixedStateStorySet() |
| 122 else: | 127 else: |
| 123 story_set = story_module.StorySet() | 128 story_set = story_module.StorySet() |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 def __init__(self): | 687 def __init__(self): |
| 683 super(FailingStory, self).__init__( | 688 super(FailingStory, self).__init__( |
| 684 shared_state_class=SimpleSharedState, | 689 shared_state_class=SimpleSharedState, |
| 685 is_local=True) | 690 is_local=True) |
| 686 self.was_run = False | 691 self.was_run = False |
| 687 | 692 |
| 688 def Run(self, shared_state): | 693 def Run(self, shared_state): |
| 689 self.was_run = True | 694 self.was_run = True |
| 690 raise legacy_page_test.Failure | 695 raise legacy_page_test.Failure |
| 691 | 696 |
| 697 @property |
| 698 def url(self): |
| 699 return 'data:,' |
| 700 |
| 692 self.SuppressExceptionFormatting() | 701 self.SuppressExceptionFormatting() |
| 693 | 702 |
| 694 story_set = story_module.StorySet() | 703 story_set = story_module.StorySet() |
| 695 for _ in range(num_failing_stories): | 704 for _ in range(num_failing_stories): |
| 696 story_set.AddStory(FailingStory()) | 705 story_set.AddStory(FailingStory()) |
| 697 | 706 |
| 698 options = _GetOptionForUnittest() | 707 options = _GetOptionForUnittest() |
| 699 options.output_formats = ['none'] | 708 options.output_formats = ['none'] |
| 700 options.suppress_gtest_report = True | 709 options.suppress_gtest_report = True |
| 701 if options_max_failures: | 710 if options_max_failures: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 723 num_failing_stories=5, runner_max_failures=3, | 732 num_failing_stories=5, runner_max_failures=3, |
| 724 options_max_failures=None, expected_num_failures=4) | 733 options_max_failures=None, expected_num_failures=4) |
| 725 | 734 |
| 726 def testMaxFailuresOption(self): | 735 def testMaxFailuresOption(self): |
| 727 # Runs up to max_failures+1 failing tests before stopping, since | 736 # Runs up to max_failures+1 failing tests before stopping, since |
| 728 # every tests after max_failures failures have been encountered | 737 # every tests after max_failures failures have been encountered |
| 729 # may all be passing. | 738 # may all be passing. |
| 730 self._testMaxFailuresOptionIsRespectedAndOverridable( | 739 self._testMaxFailuresOptionIsRespectedAndOverridable( |
| 731 num_failing_stories=5, runner_max_failures=3, | 740 num_failing_stories=5, runner_max_failures=3, |
| 732 options_max_failures=1, expected_num_failures=2) | 741 options_max_failures=1, expected_num_failures=2) |
| OLD | NEW |