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 <algorithm> | 5 #include <algorithm> |
6 #include <map> | 6 #include <map> |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" |
12 #include "base/pickle.h" | 13 #include "base/pickle.h" |
13 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/single_thread_task_runner.h" |
14 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
16 #include "base/synchronization/waitable_event.h" | 18 #include "base/synchronization/waitable_event.h" |
| 19 #include "base/thread_task_runner_handle.h" |
17 #include "chrome/browser/password_manager/native_backend_kwallet_x.h" | 20 #include "chrome/browser/password_manager/native_backend_kwallet_x.h" |
18 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
19 #include "components/autofill/core/common/password_form.h" | 22 #include "components/autofill/core/common/password_form.h" |
20 #include "components/password_manager/core/common/password_manager_pref_names.h" | 23 #include "components/password_manager/core/common/password_manager_pref_names.h" |
21 #include "content/public/test/test_browser_thread.h" | 24 #include "content/public/test/test_browser_thread.h" |
22 #include "dbus/message.h" | 25 #include "dbus/message.h" |
23 #include "dbus/mock_bus.h" | 26 #include "dbus/mock_bus.h" |
24 #include "dbus/mock_object_proxy.h" | 27 #include "dbus/mock_object_proxy.h" |
25 #include "dbus/object_path.h" | 28 #include "dbus/object_path.h" |
26 #include "dbus/object_proxy.h" | 29 #include "dbus/object_proxy.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 EXPECT_CALL( | 352 EXPECT_CALL( |
350 *mock_session_bus_.get(), | 353 *mock_session_bus_.get(), |
351 GetObjectProxy("org.kde.kwalletd", dbus::ObjectPath("/modules/kwalletd"))) | 354 GetObjectProxy("org.kde.kwalletd", dbus::ObjectPath("/modules/kwalletd"))) |
352 .WillRepeatedly(Return(mock_kwallet_proxy_.get())); | 355 .WillRepeatedly(Return(mock_kwallet_proxy_.get())); |
353 | 356 |
354 EXPECT_CALL(*mock_session_bus_.get(), ShutdownAndBlock()).WillOnce(Return()) | 357 EXPECT_CALL(*mock_session_bus_.get(), ShutdownAndBlock()).WillOnce(Return()) |
355 .WillRepeatedly(Return()); | 358 .WillRepeatedly(Return()); |
356 } | 359 } |
357 | 360 |
358 void NativeBackendKWalletTest::TearDown() { | 361 void NativeBackendKWalletTest::TearDown() { |
359 base::MessageLoop::current()->PostTask(FROM_HERE, | 362 base::ThreadTaskRunnerHandle::Get()->PostTask( |
360 base::MessageLoop::QuitClosure()); | 363 FROM_HERE, base::MessageLoop::QuitClosure()); |
361 base::MessageLoop::current()->Run(); | 364 base::MessageLoop::current()->Run(); |
362 db_thread_.Stop(); | 365 db_thread_.Stop(); |
363 } | 366 } |
364 | 367 |
365 void NativeBackendKWalletTest::TestRemoveLoginsBetween( | 368 void NativeBackendKWalletTest::TestRemoveLoginsBetween( |
366 RemoveBetweenMethod date_to_test) { | 369 RemoveBetweenMethod date_to_test) { |
367 NativeBackendKWalletStub backend(42); | 370 NativeBackendKWalletStub backend(42); |
368 EXPECT_TRUE(backend.InitWithBus(mock_session_bus_)); | 371 EXPECT_TRUE(backend.InitWithBus(mock_session_bus_)); |
369 | 372 |
370 form_google_.date_synced = base::Time(); | 373 form_google_.date_synced = base::Time(); |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 CheckVersion3Pickle(); | 1201 CheckVersion3Pickle(); |
1199 } | 1202 } |
1200 | 1203 |
1201 TEST_F(NativeBackendKWalletPickleTest, CheckVersion5Pickle) { | 1204 TEST_F(NativeBackendKWalletPickleTest, CheckVersion5Pickle) { |
1202 CheckVersion5Pickle(); | 1205 CheckVersion5Pickle(); |
1203 } | 1206 } |
1204 | 1207 |
1205 TEST_F(NativeBackendKWalletPickleTest, CheckVersion6Pickle) { | 1208 TEST_F(NativeBackendKWalletPickleTest, CheckVersion6Pickle) { |
1206 CheckVersion6Pickle(); | 1209 CheckVersion6Pickle(); |
1207 } | 1210 } |
OLD | NEW |