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

Side by Side Diff: chrome/browser/password_manager/password_store_win_unittest.cc

Issue 14103021: Use Observer to notify of WebDB load instead of callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix WIN builds Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/autofill_data_type_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <windows.h> 5 #include <windows.h>
6 #include <wincrypt.h> 6 #include <wincrypt.h>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 profile_.reset(new TestingProfile()); 114 profile_.reset(new TestingProfile());
115 115
116 login_db_.reset(new LoginDatabase()); 116 login_db_.reset(new LoginDatabase());
117 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( 117 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append(
118 FILE_PATH_LITERAL("login_test")))); 118 FILE_PATH_LITERAL("login_test"))));
119 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test"); 119 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test");
120 wdbs_ = new WebDatabaseService(path); 120 wdbs_ = new WebDatabaseService(path);
121 // Need to add at least one table so the database gets created. 121 // Need to add at least one table so the database gets created.
122 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); 122 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable()));
123 wdbs_->LoadDatabase(WebDatabaseService::InitCallback()); 123 wdbs_->LoadDatabase();
124 wds_ = new WebDataService(wdbs_, 124 wds_ = new WebDataService(wdbs_,
125 WebDataServiceBase::ProfileErrorCallback()); 125 WebDataServiceBase::ProfileErrorCallback());
126 wds_->Init(); 126 wds_->Init();
127 } 127 }
128 128
129 virtual void TearDown() { 129 virtual void TearDown() {
130 if (store_.get()) 130 if (store_.get())
131 store_->ShutdownOnUIThread(); 131 store_->ShutdownOnUIThread();
132 wds_->ShutdownOnUIThread(); 132 wds_->ShutdownOnUIThread();
133 wdbs_->ShutdownDatabase(); 133 wdbs_->ShutdownDatabase();
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 VectorOfForms expect_none; 418 VectorOfForms expect_none;
419 // expect that we get no results; 419 // expect that we get no results;
420 EXPECT_CALL( 420 EXPECT_CALL(
421 consumer, 421 consumer,
422 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) 422 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none)))
423 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); 423 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop()));
424 424
425 store_->GetAutofillableLogins(&consumer); 425 store_->GetAutofillableLogins(&consumer);
426 MessageLoop::current()->Run(); 426 MessageLoop::current()->Run();
427 } 427 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/autofill_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698