Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: tools/telemetry/telemetry/page/page_test.py

Issue 186593007: Remove href_change and navigate from wait action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/page/page_test.py
diff --git a/tools/telemetry/telemetry/page/page_test.py b/tools/telemetry/telemetry/page/page_test.py
index f2f3c7555e1a393fa47d864c2fb2649a56b4b39c..c9fb8ebcabf4705022af96801b12b51f38b806df 100644
--- a/tools/telemetry/telemetry/page/page_test.py
+++ b/tools/telemetry/telemetry/page/page_test.py
@@ -303,24 +303,16 @@ class PageTest(object):
self._test_method(page, tab, results)
def _RunCompoundAction(self, page, tab, actions, run_setup_methods=True):
- for i, action in enumerate(actions):
- prev_action = actions[i - 1] if i > 0 else None
- next_action = actions[i + 1] if i < len(actions) - 1 else None
-
- if (action.RunsPreviousAction() and
- next_action and next_action.RunsPreviousAction()):
- raise page_action.PageActionFailed('Consecutive actions cannot both '
- 'have RunsPreviousAction() == True.')
-
- if not (next_action and next_action.RunsPreviousAction()):
+ for action in actions:
+ if not action.WillWaitAfterRun():
action.WillRunAction(page, tab)
+ if run_setup_methods:
+ self.WillRunAction(page, tab, action)
+ try:
+ action.RunActionAndMaybeWait(page, tab)
+ finally:
if run_setup_methods:
- self.WillRunAction(page, tab, action)
- try:
- action.RunAction(page, tab, prev_action)
- finally:
- if run_setup_methods:
- self.DidRunAction(page, tab, action)
+ self.DidRunAction(page, tab, action)
# Note that we must not call util.CloseConnections here. Many tests
# navigate to a URL in the first action and then wait for a condition
« no previous file with comments | « tools/telemetry/telemetry/page/page_measurement_unittest.py ('k') | tools/telemetry/telemetry/page/page_test_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698