Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: components/autofill/browser/webdata/web_data_service_unittest.cc

Issue 16938006: Adds RefCountedDeleteOnMessageLoop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the gyp file Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 : ui_thread_(BrowserThread::UI, &message_loop_), 65 : ui_thread_(BrowserThread::UI, &message_loop_),
66 db_thread_(BrowserThread::DB) {} 66 db_thread_(BrowserThread::DB) {}
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 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
76 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US"))); 77 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable("en-US")));
77 wdbs_->LoadDatabase(); 78 wdbs_->LoadDatabase();
78 79
79 wds_ = new AutofillWebDataService( 80 wds_ = new AutofillWebDataService(
80 wdbs_, WebDataServiceBase::ProfileErrorCallback()); 81 wdbs_, WebDataServiceBase::ProfileErrorCallback());
81 wds_->Init(); 82 wds_->Init();
82 } 83 }
83 84
84 virtual void TearDown() { 85 virtual void TearDown() {
85 wds_->ShutdownOnUIThread(); 86 wds_->ShutdownOnUIThread();
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 529
529 // Check that the credit card was removed. 530 // Check that the credit card was removed.
530 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; 531 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2;
531 handle2 = wds_->GetCreditCards(&card_consumer2); 532 handle2 = wds_->GetCreditCards(&card_consumer2);
532 base::MessageLoop::current()->Run(); 533 base::MessageLoop::current()->Run();
533 EXPECT_EQ(handle2, card_consumer2.handle()); 534 EXPECT_EQ(handle2, card_consumer2.handle());
534 ASSERT_EQ(0U, card_consumer2.result().size()); 535 ASSERT_EQ(0U, card_consumer2.result().size());
535 } 536 }
536 537
537 } // namespace autofill 538 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_data_service_factory.cc ('k') | components/webdata/common/web_database_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698