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/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 profile_.reset(new TestingProfile()); | 277 profile_.reset(new TestingProfile()); |
278 | 278 |
279 login_db_.reset(new LoginDatabase()); | 279 login_db_.reset(new LoginDatabase()); |
280 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append("login_test"))); | 280 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append("login_test"))); |
281 | 281 |
282 wds_ = new WebDataService(); | 282 wds_ = new WebDataService(); |
283 ASSERT_TRUE(wds_->Init(temp_dir_.path())); | 283 ASSERT_TRUE(wds_->Init(temp_dir_.path())); |
284 } | 284 } |
285 | 285 |
286 virtual void TearDown() { | 286 virtual void TearDown() { |
287 wds_->Shutdown(); | 287 wds_ = NULL; |
288 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 288 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
289 MessageLoop::current()->Run(); | 289 MessageLoop::current()->Run(); |
290 db_thread_.Stop(); | 290 db_thread_.Stop(); |
291 } | 291 } |
292 | 292 |
293 PasswordStoreX::NativeBackend* GetBackend() { | 293 PasswordStoreX::NativeBackend* GetBackend() { |
294 switch (GetParam()) { | 294 switch (GetParam()) { |
295 case FAILING_BACKEND: | 295 case FAILING_BACKEND: |
296 return new FailingBackend(); | 296 return new FailingBackend(); |
297 case WORKING_BACKEND: | 297 case WORKING_BACKEND: |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 INSTANTIATE_TEST_CASE_P(NoBackend, | 746 INSTANTIATE_TEST_CASE_P(NoBackend, |
747 PasswordStoreXTest, | 747 PasswordStoreXTest, |
748 testing::Values(NO_BACKEND)); | 748 testing::Values(NO_BACKEND)); |
749 INSTANTIATE_TEST_CASE_P(FailingBackend, | 749 INSTANTIATE_TEST_CASE_P(FailingBackend, |
750 PasswordStoreXTest, | 750 PasswordStoreXTest, |
751 testing::Values(FAILING_BACKEND)); | 751 testing::Values(FAILING_BACKEND)); |
752 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 752 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
753 PasswordStoreXTest, | 753 PasswordStoreXTest, |
754 testing::Values(WORKING_BACKEND)); | 754 testing::Values(WORKING_BACKEND)); |
OLD | NEW |