| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 db_thread_(BrowserThread::DB) {} | 64 db_thread_(BrowserThread::DB) {} |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 virtual void SetUp() { | 67 virtual void SetUp() { |
| 68 db_thread_.Start(); | 68 db_thread_.Start(); |
| 69 | 69 |
| 70 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 70 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 71 base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB"); | 71 base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB"); |
| 72 | 72 |
| 73 wdbs_ = new WebDatabaseService(path); | 73 wdbs_ = new WebDatabaseService(path); |
| 74 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable())); | 74 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US"))); |
| 75 wdbs_->LoadDatabase(WebDatabaseService::InitCallback()); | 75 wdbs_->LoadDatabase(WebDatabaseService::InitCallback()); |
| 76 | 76 |
| 77 wds_ = new AutofillWebDataService( | 77 wds_ = new AutofillWebDataService( |
| 78 wdbs_, WebDataServiceBase::ProfileErrorCallback()); | 78 wdbs_, WebDataServiceBase::ProfileErrorCallback()); |
| 79 wds_->Init(); | 79 wds_->Init(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void TearDown() { | 82 virtual void TearDown() { |
| 83 wds_->ShutdownOnUIThread(); | 83 wds_->ShutdownOnUIThread(); |
| 84 wdbs_->ShutdownDatabase(); | 84 wdbs_->ShutdownDatabase(); |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 EXPECT_EQ(handle2, profile_consumer2.handle()); | 523 EXPECT_EQ(handle2, profile_consumer2.handle()); |
| 524 ASSERT_EQ(0U, profile_consumer2.result().size()); | 524 ASSERT_EQ(0U, profile_consumer2.result().size()); |
| 525 | 525 |
| 526 // Check that the credit card was removed. | 526 // Check that the credit card was removed. |
| 527 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; | 527 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; |
| 528 handle2 = wds_->GetCreditCards(&card_consumer2); | 528 handle2 = wds_->GetCreditCards(&card_consumer2); |
| 529 MessageLoop::current()->Run(); | 529 MessageLoop::current()->Run(); |
| 530 EXPECT_EQ(handle2, card_consumer2.handle()); | 530 EXPECT_EQ(handle2, card_consumer2.handle()); |
| 531 ASSERT_EQ(0U, card_consumer2.result().size()); | 531 ASSERT_EQ(0U, card_consumer2.result().size()); |
| 532 } | 532 } |
| OLD | NEW |