Commit aff97668 authored by nednguyen's avatar nednguyen Committed by Commit bot

[Telemetry] Remove page_test.DidRunActions hook.

Merge this with DidNavigateToPage since they are called and essentially called
in the same time (after page.Navigate & before page.RunPageInteractions)

BUG=455391, 470147

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

Cr-Commit-Position: refs/heads/master@{#329292}
parent eba91db0
...@@ -168,7 +168,7 @@ class OilpanGCTimesForSmoothness(_OilpanGCTimesBase): ...@@ -168,7 +168,7 @@ class OilpanGCTimesForSmoothness(_OilpanGCTimesBase):
super(OilpanGCTimesForSmoothness, self).__init__() super(OilpanGCTimesForSmoothness, self).__init__()
self._interaction = None self._interaction = None
def WillRunActions(self, page, tab): def DidNavigateToPage(self, page, tab):
runner = action_runner.ActionRunner(tab) runner = action_runner.ActionRunner(tab)
self._interaction = runner.CreateInteraction(_RUN_SMOOTH_ACTIONS) self._interaction = runner.CreateInteraction(_RUN_SMOOTH_ACTIONS)
self._interaction.Begin() self._interaction.Begin()
......
...@@ -59,7 +59,6 @@ class SmoothnessUnitTest(page_test_test_case.PageTestTestCase): ...@@ -59,7 +59,6 @@ class SmoothnessUnitTest(page_test_test_case.PageTestTestCase):
measurement = smoothness.Smoothness() measurement = smoothness.Smoothness()
measurement.WillStartBrowser(tab.browser.platform) measurement.WillStartBrowser(tab.browser.platform)
measurement.WillNavigateToPage(test_page, tab) measurement.WillNavigateToPage(test_page, tab)
measurement.WillRunActions(test_page, tab)
expected_synthetic_delay = set([ expected_synthetic_delay = set([
'DELAY(cc.BeginMainFrame;0.012000;static)', 'DELAY(cc.BeginMainFrame;0.012000;static)',
......
...@@ -26,7 +26,7 @@ class ThreadTimes(page_test.PageTest): ...@@ -26,7 +26,7 @@ class ThreadTimes(page_test.PageTest):
tracing_category_filter.CreateNoOverheadFilter().filter_string tracing_category_filter.CreateNoOverheadFilter().filter_string
self._timeline_controller.SetUp(page, tab) self._timeline_controller.SetUp(page, tab)
def WillRunActions(self, page, tab): def DidNavigateToPage(self, page, tab):
self._timeline_controller.Start(tab) self._timeline_controller.Start(tab)
def ValidateAndMeasurePage(self, page, tab, results): def ValidateAndMeasurePage(self, page, tab, results):
......
...@@ -160,9 +160,6 @@ class PageTest(object): ...@@ -160,9 +160,6 @@ class PageTest(object):
"""Override to do operations right after the page is navigated and after """Override to do operations right after the page is navigated and after
all waiting for completion has occurred.""" all waiting for completion has occurred."""
def WillRunActions(self, page, tab):
"""Override to do operations before running the actions on the page."""
def DidRunActions(self, page, tab): def DidRunActions(self, page, tab):
"""Override to do operations after running the actions on the page.""" """Override to do operations after running the actions on the page."""
...@@ -209,7 +206,6 @@ class PageTest(object): ...@@ -209,7 +206,6 @@ class PageTest(object):
# Run actions. # Run actions.
action_runner = action_runner_module.ActionRunner( action_runner = action_runner_module.ActionRunner(
tab, skip_waits=page.skip_waits) tab, skip_waits=page.skip_waits)
self.WillRunActions(page, tab)
page.RunPageInteractions(action_runner) page.RunPageInteractions(action_runner)
self.DidRunActions(page, tab) self.DidRunActions(page, tab)
self.ValidateAndMeasurePage(page, tab, results) self.ValidateAndMeasurePage(page, tab, results)
......
...@@ -39,10 +39,6 @@ class RecorderPageTest(page_test.PageTest): # pylint: disable=W0223 ...@@ -39,10 +39,6 @@ class RecorderPageTest(page_test.PageTest): # pylint: disable=W0223
if self.page_test: if self.page_test:
self.page_test.DidNavigateToPage(page, tab) self.page_test.DidNavigateToPage(page, tab)
def WillRunActions(self, page, tab):
if self.page_test:
self.page_test.WillRunActions(page, tab)
def DidRunActions(self, page, tab): def DidRunActions(self, page, tab):
if self.page_test: if self.page_test:
self.page_test.DidRunActions(page, tab) self.page_test.DidRunActions(page, tab)
......
...@@ -52,9 +52,6 @@ class MockPageTest(page_test.PageTest): ...@@ -52,9 +52,6 @@ class MockPageTest(page_test.PageTest):
def DidNavigateToPage(self, page, tab): def DidNavigateToPage(self, page, tab):
self.func_calls.append('DidNavigateToPage') self.func_calls.append('DidNavigateToPage')
def WillRunActions(self, page, tab):
self.func_calls.append('WillRunActions')
def DidRunActions(self, page, tab): def DidRunActions(self, page, tab):
self.func_calls.append('DidRunActions') self.func_calls.append('DidRunActions')
...@@ -121,11 +118,10 @@ class RecordWprUnitTests(tab_test_case.TabTestCase): ...@@ -121,11 +118,10 @@ class RecordWprUnitTests(tab_test_case.TabTestCase):
record_page_test.page_test = MockBenchmark().test() record_page_test.page_test = MockBenchmark().test()
page = MockPage(page_set=MockPageSet(url=self._url), url=self._url) page = MockPage(page_set=MockPageSet(url=self._url), url=self._url)
record_page_test.RunPage(page, self._tab, results=None) record_page_test.RunPage(page, self._tab, results=None)
self.assertEqual(3, len(record_page_test.page_test.func_calls)) self.assertEqual(2, len(record_page_test.page_test.func_calls))
self.assertEqual('WillRunActions', record_page_test.page_test.func_calls[0]) self.assertEqual('DidRunActions', record_page_test.page_test.func_calls[0])
self.assertEqual('DidRunActions', record_page_test.page_test.func_calls[1])
self.assertEqual('ValidateAndMeasurePage', self.assertEqual('ValidateAndMeasurePage',
record_page_test.page_test.func_calls[2]) record_page_test.page_test.func_calls[1])
@decorators.Disabled('chromeos') # crbug.com/404868. @decorators.Disabled('chromeos') # crbug.com/404868.
def testWprRecorderWithPageSet(self): def testWprRecorderWithPageSet(self):
......
...@@ -124,7 +124,7 @@ class SmoothGestureTest(page_test_test_case.PageTestTestCase): ...@@ -124,7 +124,7 @@ class SmoothGestureTest(page_test_test_case.PageTestTestCase):
# pylint: disable=bad-super-call # pylint: disable=bad-super-call
super(ScrollingGestureTestMeasurement, self).__init__() super(ScrollingGestureTestMeasurement, self).__init__()
def WillRunActions(self, _page, tab): def WillNavigateToPage(self, _page, tab):
options = tracing_options.TracingOptions() options = tracing_options.TracingOptions()
options.enable_chrome_trace = True options.enable_chrome_trace = True
tab.browser.platform.tracing_controller.Start( tab.browser.platform.tracing_controller.Start(
......
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