OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 } | 483 } |
484 | 484 |
485 TEST_F(NativeBackendKWalletTest, BasicStartup) { | 485 TEST_F(NativeBackendKWalletTest, BasicStartup) { |
486 NativeBackendKWalletStub kwallet(42, profile_.GetPrefs()); | 486 NativeBackendKWalletStub kwallet(42, profile_.GetPrefs()); |
487 EXPECT_TRUE(kwallet.InitWithBus(mock_session_bus_)); | 487 EXPECT_TRUE(kwallet.InitWithBus(mock_session_bus_)); |
488 EXPECT_FALSE(klauncher_contacted_); | 488 EXPECT_FALSE(klauncher_contacted_); |
489 } | 489 } |
490 | 490 |
491 // NativeBackendKWallet isn't reference counted, but in these unit tests that | 491 // NativeBackendKWallet isn't reference counted, but in these unit tests that |
492 // won't be a problem as it always outlives the threads we post tasks to. | 492 // won't be a problem as it always outlives the threads we post tasks to. |
493 template<> | 493 DISABLE_RUNNABLE_METHOD_REFCOUNT(NativeBackendKWalletStub); |
494 struct RunnableMethodTraits<NativeBackendKWalletStub> { | |
495 void RetainCallee(NativeBackendKWalletStub*) {} | |
496 void ReleaseCallee(NativeBackendKWalletStub*) {} | |
497 }; | |
498 | 494 |
499 TEST_F(NativeBackendKWalletTest, BasicAddLogin) { | 495 TEST_F(NativeBackendKWalletTest, BasicAddLogin) { |
500 // Pretend that the migration has already taken place. | 496 // Pretend that the migration has already taken place. |
501 profile_.GetPrefs()->SetBoolean(prefs::kPasswordsUseLocalProfileId, true); | 497 profile_.GetPrefs()->SetBoolean(prefs::kPasswordsUseLocalProfileId, true); |
502 | 498 |
503 NativeBackendKWalletStub backend(42, profile_.GetPrefs()); | 499 NativeBackendKWalletStub backend(42, profile_.GetPrefs()); |
504 EXPECT_TRUE(backend.InitWithBus(mock_session_bus_)); | 500 EXPECT_TRUE(backend.InitWithBus(mock_session_bus_)); |
505 | 501 |
506 // I'm not sure why base::Bind doesn't like NativeBackendKWallet[Stub], but | 502 // I'm not sure why base::Bind doesn't like NativeBackendKWallet[Stub], but |
507 // it results in compile asserts in the templatized magic of base/callback.h. | 503 // it results in compile asserts in the templatized magic of base/callback.h. |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 987 |
992 RunDBThread(); | 988 RunDBThread(); |
993 | 989 |
994 // The other two copies of the password in different profiles should remain. | 990 // The other two copies of the password in different profiles should remain. |
995 CheckPasswordForms("Chrome Form Data", expected); | 991 CheckPasswordForms("Chrome Form Data", expected); |
996 CheckPasswordForms("Chrome Form Data (42)", expected); | 992 CheckPasswordForms("Chrome Form Data (42)", expected); |
997 expected.clear(); | 993 expected.clear(); |
998 CheckPasswordForms("Chrome Form Data (24)", expected); | 994 CheckPasswordForms("Chrome Form Data (24)", expected); |
999 } | 995 } |
1000 } | 996 } |
OLD | NEW |