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

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

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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/action_runner.py ('k') | telemetry/telemetry/internal/actions/drag.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/action_runner_unittest.py
diff --git a/telemetry/telemetry/internal/actions/action_runner_unittest.py b/telemetry/telemetry/internal/actions/action_runner_unittest.py
index 4b36e5711f07c81b9f9170485154d61c2a6bebde..7cd68cd6c50e474d872afb30ccd57f4733a0c2e9 100644
--- a/telemetry/telemetry/internal/actions/action_runner_unittest.py
+++ b/telemetry/telemetry/internal/actions/action_runner_unittest.py
@@ -31,7 +31,7 @@ class ActionRunnerInteractionTest(tab_test_case.TabTestCase):
self.Navigate('interaction_enabled_page.html')
action_runner.Wait(1)
config = tracing_config.TracingConfig()
- config.chrome_trace_config.SetNoOverheadFilter()
+ config.chrome_trace_config.SetLowOverheadFilter()
config.enable_chrome_trace = True
self._browser.platform.tracing_controller.StartTracing(config)
with action_runner.CreateInteraction('InteractionName',
@@ -255,6 +255,31 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
self.assertTrue(action_runner.EvaluateJavaScript(
'(document.scrollingElement || document.body).scrollLeft') > 75)
+ def testEnterText(self):
+ self.Navigate('blank.html')
+ self._tab.ExecuteJavaScript(
+ '(function() {'
+ ' var elem = document.createElement("textarea");'
+ ' document.body.appendChild(elem);'
+ ' elem.focus();'
+ '})();')
+
+ action_runner = action_runner_module.ActionRunner(self._tab,
+ skip_waits=True)
+ action_runner.EnterText('That is boring') # That is boring|.
+ action_runner.PressKey('Home') # |That is boring.
+ action_runner.PressKey('ArrowRight', repeat_count=2) # Th|at is boring.
+ action_runner.PressKey('Delete', repeat_count=2) # Th| is boring.
+ action_runner.EnterText('is') # This| is boring.
+ action_runner.PressKey('End') # This is boring|.
+ action_runner.PressKey('ArrowLeft', repeat_count=3) # This is bor|ing.
+ action_runner.PressKey('Backspace', repeat_count=3) # This is |ing.
+ action_runner.EnterText('interest') # This is interest|ing.
+
+ self.assertEqual('This is interesting',
+ self._tab.EvaluateJavaScript(
+ 'document.querySelector("textarea").value'))
+
class InteractionTest(unittest.TestCase):
« no previous file with comments | « telemetry/telemetry/internal/actions/action_runner.py ('k') | telemetry/telemetry/internal/actions/drag.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698