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

Unified Diff: ui/aura/test/mus/input_method_mus_test_api.h

Issue 2728373003: Fixs bug resulting in double event delivery in mus (Closed)
Patch Set: global disable Created 3 years, 9 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 | « ui/aura/mus/input_method_mus_unittest.cc ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/mus/input_method_mus_test_api.h
diff --git a/ui/aura/test/mus/input_method_mus_test_api.h b/ui/aura/test/mus/input_method_mus_test_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..93f3df590c03691b93313b996a67cc61de04a6ca
--- /dev/null
+++ b/ui/aura/test/mus/input_method_mus_test_api.h
@@ -0,0 +1,38 @@
+// Copyright 2017 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.
+
+#ifndef UI_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_
+#define UI_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_
+
+#include "base/macros.h"
+#include "ui/aura/mus/input_method_mus.h"
+
+namespace aura {
+
+class InputMethodMusTestApi {
+ public:
+ static void SetInputMethod(InputMethodMus* input_method_mus,
+ ui::mojom::InputMethod* input_method) {
+ input_method_mus->input_method_ = input_method;
+ }
+
+ static void CallSendKeyEventToInputMethod(
+ InputMethodMus* input_method_mus,
+ const ui::KeyEvent& event,
+ std::unique_ptr<InputMethodMus::EventResultCallback> ack_callback) {
+ input_method_mus->SendKeyEventToInputMethod(event, std::move(ack_callback));
+ }
+
+ static void Disable(InputMethodMus* input_method) {
+ DCHECK(input_method->pending_callbacks_.empty());
+ input_method->ime_server_.reset();
+ }
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(InputMethodMusTestApi);
+};
+
+} // namespace aura
+
+#endif // UI_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_
« no previous file with comments | « ui/aura/mus/input_method_mus_unittest.cc ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698