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

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

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 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 <vector> 5 #include <vector>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/password_manager/mock_password_store.h" 10 #include "chrome/browser/password_manager/mock_password_store.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class PasswordManagerTest : public ChromeRenderViewHostTestHarness { 50 class PasswordManagerTest : public ChromeRenderViewHostTestHarness {
51 public: 51 public:
52 PasswordManagerTest() 52 PasswordManagerTest()
53 : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) {} 53 : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) {}
54 protected: 54 protected:
55 55
56 virtual void SetUp() { 56 virtual void SetUp() {
57 TestingProfile* testing_profile = new TestingProfile; 57 TestingProfile* testing_profile = new TestingProfile;
58 store_ = static_cast<MockPasswordStore*>( 58 store_ = static_cast<MockPasswordStore*>(
59 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( 59 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
60 testing_profile, MockPasswordStore::Build)); 60 testing_profile, MockPasswordStore::Build).get());
61 browser_context_.reset(testing_profile); 61 browser_context_.reset(testing_profile);
62 ChromeRenderViewHostTestHarness::SetUp(); 62 ChromeRenderViewHostTestHarness::SetUp();
63 63
64 EXPECT_CALL(delegate_, GetProfileForPasswordManager()) 64 EXPECT_CALL(delegate_, GetProfileForPasswordManager())
65 .WillRepeatedly(Return(profile())); 65 .WillRepeatedly(Return(profile()));
66 manager_.reset(new PasswordManager(contents(), &delegate_)); 66 manager_.reset(new PasswordManager(contents(), &delegate_));
67 EXPECT_CALL(delegate_, DidLastPageLoadEncounterSSLErrors()) 67 EXPECT_CALL(delegate_, DidLastPageLoadEncounterSSLErrors())
68 .WillRepeatedly(Return(false)); 68 .WillRepeatedly(Return(false));
69 } 69 }
70 70
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 EXPECT_CALL(*store_, GetLogins(_,_)) 288 EXPECT_CALL(*store_, GetLogins(_,_))
289 .WillRepeatedly(DoAll(WithArg<1>(InvokeConsumer(0, result)), Return(0))); 289 .WillRepeatedly(DoAll(WithArg<1>(InvokeConsumer(0, result)), Return(0)));
290 std::vector<PasswordForm> observed; 290 std::vector<PasswordForm> observed;
291 PasswordForm form(MakeSimpleForm()); 291 PasswordForm form(MakeSimpleForm());
292 observed.push_back(form); 292 observed.push_back(form);
293 manager()->OnPasswordFormsFound(observed); // The initial load. 293 manager()->OnPasswordFormsFound(observed); // The initial load.
294 // PasswordFormsVisible is not called. 294 // PasswordFormsVisible is not called.
295 295
296 manager()->DidStopLoading(); 296 manager()->DidStopLoading();
297 } 297 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/mock_password_store.cc ('k') | chrome/browser/password_manager/password_store_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698