| Index: tools/telemetry/telemetry/page/page_test_unittest.py
|
| diff --git a/tools/telemetry/telemetry/page/page_test_unittest.py b/tools/telemetry/telemetry/page/page_test_unittest.py
|
| index eb9f42b453195e397eededc89e0ea045d5c0b35a..296b8d3b9692e4b695caba3fdb4d2ab80ff42026 100644
|
| --- a/tools/telemetry/telemetry/page/page_test_unittest.py
|
| +++ b/tools/telemetry/telemetry/page/page_test_unittest.py
|
| @@ -23,24 +23,13 @@ class DoNothingPageTest(page_test.PageTest):
|
| pass
|
|
|
| class AppendAction(page_action.PageAction):
|
| - def RunAction(self, page, tab, previous_action):
|
| + def RunAction(self, page, tab):
|
| self.var.append(True)
|
|
|
| -class WrapAppendAction(page_action.PageAction):
|
| - def RunsPreviousAction(self):
|
| - return True
|
| -
|
| - def RunAction(self, page, tab, previous_action):
|
| - self.var.append('before')
|
| - previous_action.WillRunAction(page, tab)
|
| - previous_action.RunAction(page, tab, None)
|
| - self.var.append('after')
|
| -
|
| class PageTestUnitTest(unittest.TestCase):
|
| def setUp(self):
|
| super(PageTestUnitTest, self).setUp()
|
| all_page_actions.RegisterClassForTest('append', AppendAction)
|
| - all_page_actions.RegisterClassForTest('wrap_append', WrapAppendAction)
|
|
|
| self._page_test = DoNothingPageTest('action_to_run')
|
| self._page = _CreatePage('blank.html')
|
| @@ -56,33 +45,18 @@ class PageTestUnitTest(unittest.TestCase):
|
|
|
| self.assertTrue(action_called)
|
|
|
| - def testPreviousAction(self):
|
| - action_list = []
|
| - action_to_run = [
|
| - { 'action': 'append', 'var': action_list },
|
| - { 'action': 'wrap_append', 'var': action_list }
|
| - ]
|
| - setattr(self._page, 'action_to_run', action_to_run)
|
| -
|
| - self._page_test.Run(self._page, None, None)
|
| -
|
| - self.assertEqual(action_list, ['before', True, 'after'])
|
| -
|
| def testReferenceAction(self):
|
| action_list = []
|
| action_to_run = [
|
| - { 'action': 'referenced_action_1' },
|
| - { 'action': 'referenced_action_2' }
|
| + { 'action': 'referenced_action' },
|
| ]
|
| - referenced_action_1 = { 'action': 'append', 'var': action_list }
|
| - referenced_action_2 = { 'action': 'wrap_append', 'var': action_list }
|
| + referenced_action = { 'action': 'append', 'var': action_list }
|
| setattr(self._page, 'action_to_run', action_to_run)
|
| - setattr(self._page, 'referenced_action_1', referenced_action_1)
|
| - setattr(self._page, 'referenced_action_2', referenced_action_2)
|
| + setattr(self._page, 'referenced_action', referenced_action)
|
|
|
| self._page_test.Run(self._page, None, None)
|
|
|
| - self.assertEqual(action_list, ['before', True, 'after'])
|
| + self.assertEqual(action_list, [True])
|
|
|
| def testRepeatAction(self):
|
| action_list = []
|
| @@ -95,10 +69,9 @@ class PageTestUnitTest(unittest.TestCase):
|
|
|
| def testRepeatReferenceAction(self):
|
| action_list = []
|
| - action_to_run = { 'action': 'referenced_action', 'repeat': 2 }
|
| + action_to_run = { 'action': 'referenced_action', 'repeat': 3 }
|
| referenced_action = [
|
| { 'action': 'append', 'var': action_list },
|
| - { 'action': 'wrap_append', 'var': action_list }
|
| ]
|
| setattr(self._page, 'action_to_run', action_to_run)
|
| setattr(self._page, 'referenced_action', referenced_action)
|
| @@ -106,12 +79,6 @@ class PageTestUnitTest(unittest.TestCase):
|
| self._page_test.Run(self._page, None, None)
|
|
|
| self.assertEqual(action_list,
|
| - ['before', True, 'after', 'before', True, 'after'])
|
| + [True, True, True])
|
|
|
| - def testRepeatPreviousActionFails(self):
|
| - action_list = []
|
| - action_to_run = { 'action': 'wrap_append', 'var': action_list, 'repeat': 2 }
|
| - setattr(self._page, 'action_to_run', action_to_run)
|
|
|
| - self.assertRaises(page_action.PageActionFailed,
|
| - lambda: self._page_test.Run(self._page, None, None))
|
|
|