OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
7 #include "chrome/browser/extensions/extension_test_message_listener.h" | 7 #include "chrome/browser/extensions/extension_test_message_listener.h" |
8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
9 #include "chromeos/dbus/ibus/mock_ibus_client.h" | 9 #include "chromeos/dbus/ibus/mock_ibus_client.h" |
10 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" | 10 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 class KeyEventDoneCallback { | 129 class KeyEventDoneCallback { |
130 public: | 130 public: |
131 explicit KeyEventDoneCallback(bool expected_argument) | 131 explicit KeyEventDoneCallback(bool expected_argument) |
132 : expected_argument_(expected_argument), | 132 : expected_argument_(expected_argument), |
133 is_called_(false) {} | 133 is_called_(false) {} |
134 ~KeyEventDoneCallback() {} | 134 ~KeyEventDoneCallback() {} |
135 | 135 |
136 void Run(bool consumed) { | 136 void Run(bool consumed) { |
137 if (consumed == expected_argument_) { | 137 if (consumed == expected_argument_) { |
138 MessageLoop::current()->Quit(); | 138 base::MessageLoop::current()->Quit(); |
139 is_called_ = true; | 139 is_called_ = true; |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 void WaitUntilCalled() { | 143 void WaitUntilCalled() { |
144 while (!is_called_) | 144 while (!is_called_) |
145 content::RunMessageLoop(); | 145 content::RunMessageLoop(); |
146 } | 146 } |
147 | 147 |
148 private: | 148 private: |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ASSERT_TRUE(keyevent_listener.WaitUntilSatisfied()); | 361 ASSERT_TRUE(keyevent_listener.WaitUntilSatisfied()); |
362 EXPECT_TRUE(keyevent_listener.was_satisfied()); | 362 EXPECT_TRUE(keyevent_listener.was_satisfied()); |
363 callback.WaitUntilCalled(); | 363 callback.WaitUntilCalled(); |
364 } | 364 } |
365 // TODO(nona): Add browser tests for other API as well. | 365 // TODO(nona): Add browser tests for other API as well. |
366 } | 366 } |
367 | 367 |
368 } // namespace | 368 } // namespace |
369 } // namespace input_method | 369 } // namespace input_method |
370 } // namespace chromeos | 370 } // namespace chromeos |
OLD | NEW |