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 <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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 arg0->OnGetPasswordStoreResults(forms); | 43 arg0->OnGetPasswordStoreResults(forms); |
44 } | 44 } |
45 | 45 |
46 ACTION_P(SaveToScopedPtr, scoped) { | 46 ACTION_P(SaveToScopedPtr, scoped) { |
47 scoped->reset(arg0); | 47 scoped->reset(arg0); |
48 } | 48 } |
49 | 49 |
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, base::MessageLoopForUI::current()) {} |
54 virtual ~PasswordManagerTest() {} | 54 virtual ~PasswordManagerTest() {} |
55 | 55 |
56 protected: | 56 protected: |
57 virtual void SetUp() { | 57 virtual void SetUp() { |
58 testing_profile_ = new TestingProfile; | 58 testing_profile_ = new TestingProfile; |
59 store_ = static_cast<MockPasswordStore*>( | 59 store_ = static_cast<MockPasswordStore*>( |
60 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( | 60 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( |
61 testing_profile_, MockPasswordStore::Build).get()); | 61 testing_profile_, MockPasswordStore::Build).get()); |
62 browser_context_.reset(testing_profile_); | 62 browser_context_.reset(testing_profile_); |
63 ChromeRenderViewHostTestHarness::SetUp(); | 63 ChromeRenderViewHostTestHarness::SetUp(); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // navigation occurs. | 427 // navigation occurs. |
428 EXPECT_CALL(delegate_, | 428 EXPECT_CALL(delegate_, |
429 AddSavePasswordInfoBarIfPermitted(_)).Times(Exactly(0)); | 429 AddSavePasswordInfoBarIfPermitted(_)).Times(Exactly(0)); |
430 EXPECT_CALL(*store_, AddLogin(FormMatches(form))); | 430 EXPECT_CALL(*store_, AddLogin(FormMatches(form))); |
431 | 431 |
432 // Now the password manager waits for the navigation to complete. | 432 // Now the password manager waits for the navigation to complete. |
433 observed.clear(); | 433 observed.clear(); |
434 manager()->OnPasswordFormsParsed(observed); // The post-navigation load. | 434 manager()->OnPasswordFormsParsed(observed); // The post-navigation load. |
435 manager()->OnPasswordFormsRendered(observed); // The post-navigation layout. | 435 manager()->OnPasswordFormsRendered(observed); // The post-navigation layout. |
436 } | 436 } |
OLD | NEW |