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

Unified Diff: telemetry/telemetry/internal/actions/tap.py

Issue 2178903002: [telemetry] Handle immediate navigation triggered by tap action (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: s/windows/win/g Created 4 years, 4 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 | « no previous file | telemetry/telemetry/internal/actions/tap_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/tap.py
diff --git a/telemetry/telemetry/internal/actions/tap.py b/telemetry/telemetry/internal/actions/tap.py
index 092e8a8b083271c373264007a4270c7d956dc1b5..99263bdc8adfefd96b6e36d6643efe6a497934de 100644
--- a/telemetry/telemetry/internal/actions/tap.py
+++ b/telemetry/telemetry/internal/actions/tap.py
@@ -67,4 +67,8 @@ class TapAction(page_action.PageAction):
page_action.EvaluateCallbackWithElement(
tab, code, selector=self.selector, text=self.text,
element_function=self.element_function)
- tab.WaitForJavaScriptExpression('window.__tapActionDone', 60)
+ # The second disjunct handles the case where the tap action leads to an
+ # immediate navigation (in which case the expression below might already be
+ # evaluated on the new page).
+ tab.WaitForJavaScriptExpression(
+ 'window.__tapActionDone || window.__tapAction === undefined', 60)
« no previous file with comments | « no previous file | telemetry/telemetry/internal/actions/tap_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698