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): |