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

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

Issue 2174273002: [telemetry] Don't use time.sleep in text entry tests (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: 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 | « no previous file | telemetry/telemetry/internal/actions/key_event_unittest.py » ('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 3b190c8cf8547f2aa4863d625110dc601f572eaf..a6d75651d057da1ed851de30a81738b416b4605b 100644
--- a/telemetry/telemetry/internal/actions/action_runner_unittest.py
+++ b/telemetry/telemetry/internal/actions/action_runner_unittest.py
@@ -276,13 +276,11 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
action_runner.PressKey('Backspace', repeat_count=3) # This is |ing.
action_runner.EnterText('interest') # This is interest|ing.
- # Wait for a second to make sure that all keystrokes have been handled by
- # the browser (crbug.com/630017).
- action_runner.Wait(1)
-
- self.assertEqual('This is interesting',
- self._tab.EvaluateJavaScript(
- 'document.querySelector("textarea").value'))
+ # Check that the contents of the textarea is correct. It might take a second
+ # until all keystrokes have been handled by the browser (crbug.com/630017).
+ self._tab.WaitForJavaScriptExpression(
+ 'document.querySelector("textarea").value === "This is interesting"',
+ timeout=1)
achuithb 2016/07/25 18:44:34 You could consider increasing the timeout to a few
class InteractionTest(unittest.TestCase):
« no previous file with comments | « no previous file | telemetry/telemetry/internal/actions/key_event_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698