OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from telemetry.page import all_page_actions |
5 from telemetry import all_page_actions | 5 from telemetry.page import compound_action |
6 from telemetry import compound_action | 6 from telemetry.page import page_action |
7 from telemetry import page_action | 7 from telemetry.test import tab_test_case |
8 from telemetry import tab_test_case | |
9 | 8 |
10 class AppendAction(page_action.PageAction): | 9 class AppendAction(page_action.PageAction): |
11 def RunAction(self, page, tab, previous_action): | 10 def RunAction(self, page, tab, previous_action): |
12 self.var.append(True) | 11 self.var.append(True) |
13 | 12 |
14 class WrapAppendAction(page_action.PageAction): | 13 class WrapAppendAction(page_action.PageAction): |
15 def RunsPreviousAction(self): | 14 def RunsPreviousAction(self): |
16 return True | 15 return True |
17 | 16 |
18 def RunAction(self, page, tab, previous_action): | 17 def RunAction(self, page, tab, previous_action): |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 { | 69 { |
71 'action': 'compound_action', | 70 'action': 'compound_action', |
72 'actions': [ | 71 'actions': [ |
73 { 'action': 'wrap_append', 'var': action_list } | 72 { 'action': 'wrap_append', 'var': action_list } |
74 ] | 73 ] |
75 } | 74 } |
76 ] | 75 ] |
77 }) | 76 }) |
78 action.RunAction(None, self._tab, None) | 77 action.RunAction(None, self._tab, None) |
79 self.assertEqual(action_list, ['before', True, 'after']) | 78 self.assertEqual(action_list, ['before', True, 'after']) |
OLD | NEW |