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

Side by Side Diff: chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc

Issue 16296002: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 ASSERT_TRUE(db_thread_.Start()); 243 ASSERT_TRUE(db_thread_.Start());
244 244
245 dbus::Bus::Options options; 245 dbus::Bus::Options options;
246 options.bus_type = dbus::Bus::SESSION; 246 options.bus_type = dbus::Bus::SESSION;
247 mock_session_bus_ = new dbus::MockBus(options); 247 mock_session_bus_ = new dbus::MockBus(options);
248 248
249 mock_klauncher_proxy_ = 249 mock_klauncher_proxy_ =
250 new dbus::MockObjectProxy(mock_session_bus_.get(), 250 new dbus::MockObjectProxy(mock_session_bus_.get(),
251 "org.kde.klauncher", 251 "org.kde.klauncher",
252 dbus::ObjectPath("/KLauncher")); 252 dbus::ObjectPath("/KLauncher"));
253 EXPECT_CALL(*mock_klauncher_proxy_, 253 EXPECT_CALL(*mock_klauncher_proxy_.get(), MockCallMethodAndBlock(_, _))
254 MockCallMethodAndBlock(_, _)) 254 .WillRepeatedly(
255 .WillRepeatedly(Invoke(this, 255 Invoke(this, &NativeBackendKWalletTest::KLauncherMethodCall));
256 &NativeBackendKWalletTest::KLauncherMethodCall));
257 256
258 mock_kwallet_proxy_ = 257 mock_kwallet_proxy_ =
259 new dbus::MockObjectProxy(mock_session_bus_.get(), 258 new dbus::MockObjectProxy(mock_session_bus_.get(),
260 "org.kde.kwalletd", 259 "org.kde.kwalletd",
261 dbus::ObjectPath("/modules/kwalletd")); 260 dbus::ObjectPath("/modules/kwalletd"));
262 EXPECT_CALL(*mock_kwallet_proxy_, 261 EXPECT_CALL(*mock_kwallet_proxy_.get(), MockCallMethodAndBlock(_, _))
263 MockCallMethodAndBlock(_, _)) 262 .WillRepeatedly(
264 .WillRepeatedly(Invoke(this, 263 Invoke(this, &NativeBackendKWalletTest::KWalletMethodCall));
265 &NativeBackendKWalletTest::KWalletMethodCall));
266 264
267 EXPECT_CALL(*mock_session_bus_, GetObjectProxy( 265 EXPECT_CALL(
268 "org.kde.klauncher", 266 *mock_session_bus_.get(),
269 dbus::ObjectPath("/KLauncher"))) 267 GetObjectProxy("org.kde.klauncher", dbus::ObjectPath("/KLauncher")))
270 .WillRepeatedly(Return(mock_klauncher_proxy_.get())); 268 .WillRepeatedly(Return(mock_klauncher_proxy_.get()));
271 EXPECT_CALL(*mock_session_bus_, GetObjectProxy( 269 EXPECT_CALL(
272 "org.kde.kwalletd", 270 *mock_session_bus_.get(),
273 dbus::ObjectPath("/modules/kwalletd"))) 271 GetObjectProxy("org.kde.kwalletd", dbus::ObjectPath("/modules/kwalletd")))
274 .WillRepeatedly(Return(mock_kwallet_proxy_.get())); 272 .WillRepeatedly(Return(mock_kwallet_proxy_.get()));
275 273
276 EXPECT_CALL(*mock_session_bus_, 274 EXPECT_CALL(*mock_session_bus_.get(), ShutdownAndBlock()).WillOnce(Return())
277 ShutdownAndBlock()).WillOnce(Return()).WillRepeatedly(Return()); 275 .WillRepeatedly(Return());
278 } 276 }
279 277
280 void NativeBackendKWalletTest::TearDown() { 278 void NativeBackendKWalletTest::TearDown() {
281 base::MessageLoop::current()->PostTask(FROM_HERE, 279 base::MessageLoop::current()->PostTask(FROM_HERE,
282 base::MessageLoop::QuitClosure()); 280 base::MessageLoop::QuitClosure());
283 base::MessageLoop::current()->Run(); 281 base::MessageLoop::current()->Run();
284 db_thread_.Stop(); 282 db_thread_.Stop();
285 } 283 }
286 284
287 dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall( 285 dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall(
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC); 1078 CheckVersion0Pickle(true, PasswordForm::SCHEME_BASIC);
1081 } 1079 }
1082 1080
1083 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) { 1081 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTMLPickles) {
1084 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML); 1082 CheckVersion0Pickle(false, PasswordForm::SCHEME_HTML);
1085 } 1083 }
1086 1084
1087 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) { 1085 TEST_F(NativeBackendKWalletPickleTest, ReadsOld64BitHTTPPickles) {
1088 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC); 1086 CheckVersion0Pickle(false, PasswordForm::SCHEME_BASIC);
1089 } 1087 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698