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

Side by Side Diff: chrome/browser/webdata/web_data_service_unittest.cc

Issue 12871006: Second try at splitting WebDataService (minus ownership changes) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix WIN paths Created 7 years, 9 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 | Annotate | Revision Log
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 WebDataServiceTest() 70 WebDataServiceTest()
71 : ui_thread_(BrowserThread::UI, &message_loop_), 71 : ui_thread_(BrowserThread::UI, &message_loop_),
72 db_thread_(BrowserThread::DB) {} 72 db_thread_(BrowserThread::DB) {}
73 73
74 protected: 74 protected:
75 virtual void SetUp() { 75 virtual void SetUp() {
76 db_thread_.Start(); 76 db_thread_.Start();
77 77
78 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 78 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
79 wds_ = new WebDataService(); 79 wds_ = new WebDataService();
80 wds_->Init(temp_dir_.path()); 80 base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB");
81 wds_->Init(path);
81 } 82 }
82 83
83 virtual void TearDown() { 84 virtual void TearDown() {
84 wds_->ShutdownOnUIThread(); 85 wds_->ShutdownOnUIThread();
85 wds_ = NULL; 86 wds_ = NULL;
86 WaitForDatabaseThread(); 87 WaitForDatabaseThread();
87 88
88 db_thread_.Stop(); 89 db_thread_.Stop();
89 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 90 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
90 MessageLoop::current()->Run(); 91 MessageLoop::current()->Run();
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 EXPECT_EQ(handle2, profile_consumer2.handle()); 540 EXPECT_EQ(handle2, profile_consumer2.handle());
540 ASSERT_EQ(0U, profile_consumer2.result().size()); 541 ASSERT_EQ(0U, profile_consumer2.result().size());
541 542
542 // Check that the credit card was removed. 543 // Check that the credit card was removed.
543 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2; 544 AutofillWebDataServiceConsumer<std::vector<CreditCard*> > card_consumer2;
544 handle2 = wds_->GetCreditCards(&card_consumer2); 545 handle2 = wds_->GetCreditCards(&card_consumer2);
545 MessageLoop::current()->Run(); 546 MessageLoop::current()->Run();
546 EXPECT_EQ(handle2, card_consumer2.handle()); 547 EXPECT_EQ(handle2, card_consumer2.handle());
547 ASSERT_EQ(0U, card_consumer2.result().size()); 548 ASSERT_EQ(0U, card_consumer2.result().size());
548 } 549 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698