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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 StartSyncFlareMock() {} | 36 StartSyncFlareMock() {} |
37 ~StartSyncFlareMock() {} | 37 ~StartSyncFlareMock() {} |
38 | 38 |
39 MOCK_METHOD1(StartSyncFlare, void(syncer::ModelType)); | 39 MOCK_METHOD1(StartSyncFlare, void(syncer::ModelType)); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 class PasswordStoreTest : public testing::Test { | 44 class PasswordStoreTest : public testing::Test { |
45 protected: | 45 protected: |
46 virtual void SetUp() override { | 46 void SetUp() override { |
47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
48 login_db_.reset(new LoginDatabase()); | 48 login_db_.reset(new LoginDatabase()); |
49 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( | 49 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( |
50 FILE_PATH_LITERAL("login_test")))); | 50 FILE_PATH_LITERAL("login_test")))); |
51 } | 51 } |
52 | 52 |
53 virtual void TearDown() override { | 53 void TearDown() override { ASSERT_TRUE(temp_dir_.Delete()); } |
54 ASSERT_TRUE(temp_dir_.Delete()); | |
55 } | |
56 | 54 |
57 base::MessageLoopForUI message_loop_; | 55 base::MessageLoopForUI message_loop_; |
58 scoped_ptr<LoginDatabase> login_db_; | 56 scoped_ptr<LoginDatabase> login_db_; |
59 base::ScopedTempDir temp_dir_; | 57 base::ScopedTempDir temp_dir_; |
60 }; | 58 }; |
61 | 59 |
62 ACTION(STLDeleteElements0) { | 60 ACTION(STLDeleteElements0) { |
63 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 61 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
64 } | 62 } |
65 | 63 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 PasswordForm form; | 203 PasswordForm form; |
206 EXPECT_CALL(mock, StartSyncFlare(syncer::PASSWORDS)); | 204 EXPECT_CALL(mock, StartSyncFlare(syncer::PASSWORDS)); |
207 store->AddLogin(form); | 205 store->AddLogin(form); |
208 base::MessageLoop::current()->RunUntilIdle(); | 206 base::MessageLoop::current()->RunUntilIdle(); |
209 } | 207 } |
210 store->Shutdown(); | 208 store->Shutdown(); |
211 base::MessageLoop::current()->RunUntilIdle(); | 209 base::MessageLoop::current()->RunUntilIdle(); |
212 } | 210 } |
213 | 211 |
214 } // namespace password_manager | 212 } // namespace password_manager |
OLD | NEW |