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

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

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "content/public/test/browser_test_utils.h" 9 #include "content/public/test/browser_test_utils.h"
10 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 class KeyEventDoneCallback { 113 class KeyEventDoneCallback {
114 public: 114 public:
115 explicit KeyEventDoneCallback(bool expected_argument) 115 explicit KeyEventDoneCallback(bool expected_argument)
116 : expected_argument_(expected_argument), 116 : expected_argument_(expected_argument),
117 is_called_(false) {} 117 is_called_(false) {}
118 ~KeyEventDoneCallback() {} 118 ~KeyEventDoneCallback() {}
119 119
120 void Run(bool consumed) { 120 void Run(bool consumed) {
121 if (consumed == expected_argument_) { 121 if (consumed == expected_argument_) {
122 base::MessageLoop::current()->Quit(); 122 base::MessageLoop::current()->QuitWhenIdle();
123 is_called_ = true; 123 is_called_ = true;
124 } 124 }
125 } 125 }
126 126
127 void WaitUntilCalled() { 127 void WaitUntilCalled() {
128 while (!is_called_) 128 while (!is_called_)
129 content::RunMessageLoop(); 129 content::RunMessageLoop();
130 } 130 }
131 131
132 private: 132 private:
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 EXPECT_EQ("", mock_input_context->last_commit_text()); 1040 EXPECT_EQ("", mock_input_context->last_commit_text());
1041 } 1041 }
1042 1042
1043 IMEBridge::Get()->SetInputContextHandler(NULL); 1043 IMEBridge::Get()->SetInputContextHandler(NULL);
1044 IMEBridge::Get()->SetCandidateWindowHandler(NULL); 1044 IMEBridge::Get()->SetCandidateWindowHandler(NULL);
1045 } 1045 }
1046 1046
1047 } // namespace 1047 } // namespace
1048 } // namespace input_method 1048 } // namespace input_method
1049 } // namespace chromeos 1049 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698