Commit 750b6051 authored by nednguyen's avatar nednguyen Committed by Commit bot

[Telemetry] Remove results param in shared_state.TearDownState().

The results param was needed in shared_state.TearDownState() because of
page_test.DidRunTest hook. Now that hook is removed, we no longer need to
provide access to the results object in this method.

BUG=435757

Review URL: https://codereview.chromium.org/1140143002

Cr-Commit-Position: refs/heads/master@{#329887}
parent 228997b2
......@@ -222,7 +222,7 @@ def Run(test, user_story_set, expectations, finder_options, results,
try:
# If TearDownState raises, do not catch the exception.
# (The Error was saved as a failure value.)
state.TearDownState(results)
state.TearDownState()
finally:
# Later finally-blocks use state, so ensure it is cleared.
state = None
......@@ -246,7 +246,7 @@ def Run(test, user_story_set, expectations, finder_options, results,
if state:
has_existing_exception = sys.exc_info() is not None
try:
state.TearDownState(results)
state.TearDownState()
except Exception:
if not has_existing_exception:
raise
......
......@@ -64,7 +64,7 @@ class TestSharedState(shared_state.SharedState):
def DidRunUserStory(self, results):
pass
def TearDownState(self, results):
def TearDownState(self):
pass
......@@ -250,7 +250,7 @@ class StoryRunnerTest(unittest.TestCase):
super(FoozUserStoryState, self).__init__(
test, options, user_story_setz)
fooz_init_call_counter[0] += 1
def TearDownState(self, _results):
def TearDownState(self):
fooz_tear_down_call_counter[0] += 1
class BarzUserStoryState(BarUserStoryState):
......@@ -258,7 +258,7 @@ class StoryRunnerTest(unittest.TestCase):
super(BarzUserStoryState, self).__init__(
test, options, user_story_setz)
barz_init_call_counter[0] += 1
def TearDownState(self, _results):
def TearDownState(self):
barz_tear_down_call_counter[0] += 1
def AssertAndCleanUpFoo():
self.assertEquals(1, fooz_init_call_counter[0])
......@@ -369,7 +369,7 @@ class StoryRunnerTest(unittest.TestCase):
pass
class TestTearDownSharedState(TestSharedPageState):
def TearDownState(self, results):
def TearDownState(self):
unit_test_events.append('tear-down-state')
raise DidRunTestError
......@@ -512,7 +512,7 @@ class StoryRunnerTest(unittest.TestCase):
def GetTestExpectationAndSkipValue(self, expectations):
return 'pass', None
def TearDownState(self, results):
def TearDownState(self):
pass
class FailingUserStory(user_story.UserStory):
......
......@@ -267,7 +267,7 @@ class SharedPageState(shared_state.SharedState):
raise page_test.MultiTabTestAppCrashError
raise
def TearDownState(self, results):
def TearDownState(self):
self._StopBrowser()
def _StopBrowser(self):
......
......@@ -55,7 +55,7 @@ class SharedState(object):
"""
raise NotImplementedError()
def TearDownState(self, results):
def TearDownState(self):
""" Override to do any action after running multiple user stories that
share this same state.
This method is styled on unittest.TestCase.tearDownClass.
......
......@@ -68,7 +68,7 @@ class SharedAppState(shared_state.SharedState):
"""This does not apply to android app user stories."""
return 'pass', None
def TearDownState(self, results):
def TearDownState(self):
"""Tear down anything created in the __init__ method that is not needed.
Currently, there is no clean-up needed from SharedAppState.__init__.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment