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

Unified Diff: telemetry/telemetry/internal/actions/tap_unittest.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 | « telemetry/telemetry/internal/actions/tap.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/tap_unittest.py
diff --git a/telemetry/telemetry/internal/actions/tap_unittest.py b/telemetry/telemetry/internal/actions/tap_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..75b1f48023f5477965028ec56e330e50cec48fac
--- /dev/null
+++ b/telemetry/telemetry/internal/actions/tap_unittest.py
@@ -0,0 +1,39 @@
+# Copyright 2016 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.
+
+from telemetry import decorators
+from telemetry.internal.actions import tap
+from telemetry.testing import tab_test_case
+
+class TapActionTest(tab_test_case.TabTestCase):
+
+ def _PerformTapAction(self, *args, **kwargs):
+ action = tap.TapAction(*args, **kwargs)
+ action.WillRunAction(self._tab)
+ action.RunAction(self._tab)
+
+ @decorators.Disabled('win') # http://crbug.com/634343
+ def testTapSinglePage(self):
+ self.Navigate('page_with_clickables.html')
+
+ self._tab.ExecuteJavaScript('valueSettableByTest = 1;')
+ self._PerformTapAction('#test')
+ self.assertEqual(1, self._tab.EvaluateJavaScript('valueToTest'))
+
+ self._tab.ExecuteJavaScript('valueSettableByTest = 2;')
+ self._PerformTapAction(text='Click/tap me')
+ self.assertEqual(2, self._tab.EvaluateJavaScript('valueToTest'))
+
+ self._tab.ExecuteJavaScript('valueSettableByTest = 3;')
+ self._PerformTapAction(element_function='document.body.firstElementChild')
+ self.assertEqual(3, self._tab.EvaluateJavaScript('valueToTest'))
+
+ @decorators.Disabled('win') # http://crbug.com/634343
+ def testTapNavigate(self):
+ self.Navigate('page_with_link.html')
+ self._PerformTapAction(selector='#clickme')
+ self._tab.WaitForJavaScriptExpression(
+ 'document.location.pathname === "/blank.html"', timeout=5)
+ self._tab.WaitForJavaScriptExpression(
+ 'document.readyState === "complete"', timeout=5)
« no previous file with comments | « telemetry/telemetry/internal/actions/tap.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698