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

Side by Side Diff: chrome/browser/password_manager/native_backend_kwallet_x_unittest.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 <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 event->Signal(); 205 event->Signal();
206 } 206 }
207 207
208 // Utilities to help verify sets of expectations. 208 // Utilities to help verify sets of expectations.
209 typedef std::vector< 209 typedef std::vector<
210 std::pair<std::string, 210 std::pair<std::string,
211 std::vector<const PasswordForm*> > > ExpectationArray; 211 std::vector<const PasswordForm*> > > ExpectationArray;
212 void CheckPasswordForms(const std::string& folder, 212 void CheckPasswordForms(const std::string& folder,
213 const ExpectationArray& sorted_expected); 213 const ExpectationArray& sorted_expected);
214 214
215 MessageLoopForUI message_loop_; 215 base::MessageLoopForUI message_loop_;
216 content::TestBrowserThread ui_thread_; 216 content::TestBrowserThread ui_thread_;
217 content::TestBrowserThread db_thread_; 217 content::TestBrowserThread db_thread_;
218 TestingProfile profile_; 218 TestingProfile profile_;
219 219
220 scoped_refptr<dbus::MockBus> mock_session_bus_; 220 scoped_refptr<dbus::MockBus> mock_session_bus_;
221 scoped_refptr<dbus::MockObjectProxy> mock_klauncher_proxy_; 221 scoped_refptr<dbus::MockObjectProxy> mock_klauncher_proxy_;
222 scoped_refptr<dbus::MockObjectProxy> mock_kwallet_proxy_; 222 scoped_refptr<dbus::MockObjectProxy> mock_kwallet_proxy_;
223 223
224 int klauncher_ret_; 224 int klauncher_ret_;
225 std::string klauncher_error_; 225 std::string klauncher_error_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 EXPECT_CALL(*mock_session_bus_, GetObjectProxy( 271 EXPECT_CALL(*mock_session_bus_, GetObjectProxy(
272 "org.kde.kwalletd", 272 "org.kde.kwalletd",
273 dbus::ObjectPath("/modules/kwalletd"))) 273 dbus::ObjectPath("/modules/kwalletd")))
274 .WillRepeatedly(Return(mock_kwallet_proxy_.get())); 274 .WillRepeatedly(Return(mock_kwallet_proxy_.get()));
275 275
276 EXPECT_CALL(*mock_session_bus_, 276 EXPECT_CALL(*mock_session_bus_,
277 ShutdownAndBlock()).WillOnce(Return()).WillRepeatedly(Return()); 277 ShutdownAndBlock()).WillOnce(Return()).WillRepeatedly(Return());
278 } 278 }
279 279
280 void NativeBackendKWalletTest::TearDown() { 280 void NativeBackendKWalletTest::TearDown() {
281 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 281 base::MessageLoop::current()->PostTask(FROM_HERE,
282 MessageLoop::current()->Run(); 282 base::MessageLoop::QuitClosure());
283 base::MessageLoop::current()->Run();
283 db_thread_.Stop(); 284 db_thread_.Stop();
284 } 285 }
285 286
286 dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall( 287 dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall(
287 dbus::MethodCall* method_call, testing::Unused) { 288 dbus::MethodCall* method_call, testing::Unused) {
288 EXPECT_EQ("org.kde.KLauncher", method_call->GetInterface()); 289 EXPECT_EQ("org.kde.KLauncher", method_call->GetInterface());
289 EXPECT_EQ("start_service_by_desktop_name", method_call->GetMember()); 290 EXPECT_EQ("start_service_by_desktop_name", method_call->GetMember());
290 291
291 klauncher_contacted_ = true; 292 klauncher_contacted_ = true;
292 293
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC); 1080 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC);
1080 } 1081 }
1081 1082
1082 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) { 1083 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) {
1083 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML); 1084 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML);
1084 } 1085 }
1085 1086
1086 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) { 1087 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) {
1087 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC); 1088 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC);
1088 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698