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

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

Issue 1181623004: [Password Manager] Replace "this site" in save password prompt with password's origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" 6 #include "chrome/browser/password_manager/save_password_infobar_delegate.h"
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
8 #include "components/autofill/core/common/password_form.h" 8 #include "components/autofill/core/common/password_form.h"
9 #include "components/password_manager/core/browser/password_form_manager.h" 9 #include "components/password_manager/core/browser/password_form_manager.h"
10 #include "components/password_manager/core/browser/password_manager_client.h" 10 #include "components/password_manager/core/browser/password_manager_client.h"
(...skipping 19 matching lines...) Expand all
30 30
31 private: 31 private:
32 DISALLOW_COPY_AND_ASSIGN(MockPasswordFormManager); 32 DISALLOW_COPY_AND_ASSIGN(MockPasswordFormManager);
33 }; 33 };
34 34
35 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate { 35 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate {
36 public: 36 public:
37 TestSavePasswordInfobarDelegate( 37 TestSavePasswordInfobarDelegate(
38 scoped_ptr<password_manager::PasswordFormManager> form_to_save, 38 scoped_ptr<password_manager::PasswordFormManager> form_to_save,
39 password_manager::CredentialSourceType source_type) 39 password_manager::CredentialSourceType source_type)
40 : SavePasswordInfoBarDelegate(form_to_save.Pass(), 40 : SavePasswordInfoBarDelegate(nullptr,
vivekg 2015/06/23 14:38:01 Should we have a detailed test which verifies the
Pritam Nikam 2015/06/25 08:59:14 I've removed WebCotents dependency. Moreover, adde
41 form_to_save.Pass(),
41 std::string(), 42 std::string(),
42 source_type, 43 source_type,
43 true /* is_smartlock_branding_enabled */) {} 44 true /* is_smartlock_branding_enabled */) {}
44 ~TestSavePasswordInfobarDelegate() override {} 45 ~TestSavePasswordInfobarDelegate() override {}
45 }; 46 };
46 47
47 } // namespace 48 } // namespace
48 49
49 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { 50 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness {
50 public: 51 public:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 CancelTestCredentialSourcePasswordManager) { 114 CancelTestCredentialSourcePasswordManager) {
114 scoped_ptr<MockPasswordFormManager> password_form_manager( 115 scoped_ptr<MockPasswordFormManager> password_form_manager(
115 CreateMockFormManager()); 116 CreateMockFormManager());
116 EXPECT_CALL(*password_form_manager.get(), PermanentlyBlacklist()) 117 EXPECT_CALL(*password_form_manager.get(), PermanentlyBlacklist())
117 .Times(testing::Exactly(1)); 118 .Times(testing::Exactly(1));
118 scoped_ptr<ConfirmInfoBarDelegate> infobar(CreateDelegate( 119 scoped_ptr<ConfirmInfoBarDelegate> infobar(CreateDelegate(
119 password_form_manager.Pass(), password_manager::CredentialSourceType:: 120 password_form_manager.Pass(), password_manager::CredentialSourceType::
120 CREDENTIAL_SOURCE_PASSWORD_MANAGER)); 121 CREDENTIAL_SOURCE_PASSWORD_MANAGER));
121 EXPECT_TRUE(infobar->Cancel()); 122 EXPECT_TRUE(infobar->Cancel());
122 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698