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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 protected: | 68 protected: |
69 virtual void SetUp() { | 69 virtual void SetUp() { |
70 db_thread_.Start(); | 70 db_thread_.Start(); |
71 | 71 |
72 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 72 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
73 base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB"); | 73 base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB"); |
74 | 74 |
75 wdbs_ = new WebDatabaseService(path); | 75 wdbs_ = new WebDatabaseService(path); |
76 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US"))); | 76 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US"))); |
77 wdbs_->LoadDatabase(WebDatabaseService::InitCallback()); | 77 wdbs_->LoadDatabase(); |
78 | 78 |
79 wds_ = new AutofillWebDataService( | 79 wds_ = new AutofillWebDataService( |
80 wdbs_, WebDataServiceBase::ProfileErrorCallback()); | 80 wdbs_, WebDataServiceBase::ProfileErrorCallback()); |
81 wds_->Init(); | 81 wds_->Init(); |
82 } | 82 } |
83 | 83 |
84 virtual void TearDown() { | 84 virtual void TearDown() { |
85 wds_->ShutdownOnUIThread(); | 85 wds_->ShutdownOnUIThread(); |
86 wdbs_->ShutdownDatabase(); | 86 wdbs_->ShutdownDatabase(); |
87 wds_ = NULL; | 87 wds_ = NULL; |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 527 |
528 // Check that the credit card was removed. | 528 // Check that the credit card was removed. |
529 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; | 529 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; |
530 handle2 = wds_->GetCreditCards(&card_consumer2); | 530 handle2 = wds_->GetCreditCards(&card_consumer2); |
531 MessageLoop::current()->Run(); | 531 MessageLoop::current()->Run(); |
532 EXPECT_EQ(handle2, card_consumer2.handle()); | 532 EXPECT_EQ(handle2, card_consumer2.handle()); |
533 ASSERT_EQ(0U, card_consumer2.result().size()); | 533 ASSERT_EQ(0U, card_consumer2.result().size()); |
534 } | 534 } |
535 | 535 |
536 } // namespace autofill | 536 } // namespace autofill |
OLD | NEW |