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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine_ibus_browserttests.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698