| 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 from telemetry import page_action | 4 from telemetry import page_action |
| 5 | 5 |
| 6 class CompoundAction(page_action.PageAction): | 6 class CompoundAction(page_action.PageAction): |
| 7 def __init__(self, attributes=None): | 7 def __init__(self, attributes=None): |
| 8 super(CompoundAction, self).__init__(attributes) | 8 super(CompoundAction, self).__init__(attributes) |
| 9 self._actions = [] | 9 self._actions = [] |
| 10 from telemetry import all_page_actions | 10 from telemetry import all_page_actions |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 next_action = self._actions[i + 1] if i < len(self._actions) - 1 else None | 26 next_action = self._actions[i + 1] if i < len(self._actions) - 1 else None |
| 27 | 27 |
| 28 if (action.RunsPreviousAction() and | 28 if (action.RunsPreviousAction() and |
| 29 next_action and next_action.RunsPreviousAction()): | 29 next_action and next_action.RunsPreviousAction()): |
| 30 raise page_action.PageActionFailed('Consecutive actions cannot both ' | 30 raise page_action.PageActionFailed('Consecutive actions cannot both ' |
| 31 'have RunsPreviousAction() == True.') | 31 'have RunsPreviousAction() == True.') |
| 32 | 32 |
| 33 if not (next_action and next_action.RunsPreviousAction()): | 33 if not (next_action and next_action.RunsPreviousAction()): |
| 34 action.WillRunAction(page, tab) | 34 action.WillRunAction(page, tab) |
| 35 action.RunAction(page, tab, prev_action) | 35 action.RunAction(page, tab, prev_action) |
| OLD | NEW |