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

Unified Diff: tools/telemetry/telemetry/page/actions/action_runner.py

Issue 180873008: Add support for python pageset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove attributes from page constructor 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
« no previous file with comments | « tools/telemetry/telemetry/core/util.py ('k') | tools/telemetry/telemetry/page/actions/page_action.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/action_runner.py
diff --git a/tools/telemetry/telemetry/page/actions/action_runner.py b/tools/telemetry/telemetry/page/actions/action_runner.py
new file mode 100644
index 0000000000000000000000000000000000000000..c0c23698d2f69675db06d7f2523f7851defd9a4b
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/action_runner.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class ActionRunner(object):
+ def __init__(self, page, tab, page_test=None):
+ self._page = page
+ self._tab = tab
+ self._page_test = page_test
+
+ def RunAction(self, action):
+ if not action.WillWaitAfterRun():
+ action.WillRunAction(self._page, self._tab)
+ if self._page_test:
+ self._page_test.WillRunAction(self._page, self._tab, action)
+ try:
+ action.RunActionAndMaybeWait(self._page, self._tab)
+ finally:
+ if self._page_test:
+ self._page_test.DidRunAction(self._page, self._tab, action)
« no previous file with comments | « tools/telemetry/telemetry/core/util.py ('k') | tools/telemetry/telemetry/page/actions/page_action.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698