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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 2387353004: Delay Input.dispatchKeyEvent response until after key event ack. (Closed)
Patch Set: remove |is_synthetic|, fixed bug for mouse acks, add test for mouse events Created 4 years, 1 month 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
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 139301fa6344bb2f3106253aaed144e11cdb2a7e..3cc4054a052a9d89279cd3162c3528e1c71730d7 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -1519,9 +1519,13 @@ bool InputMsgWatcher::OnMessageReceived(const IPC::Message& message) {
return false;
}
+bool InputMsgWatcher::HasReceivedAck() {
+ return ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN;
+}
+
uint32_t InputMsgWatcher::WaitForAck() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN)
+ if (HasReceivedAck())
return ack_result_;
base::RunLoop run_loop;
base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());

Powered by Google App Engine
This is Rietveld 408576698