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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_test.cc

Issue 1009953002: Integrate ManagePasswordsState into ManagePasswordsUIController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed the comments Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/passwords/manage_passwords_test.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void ManagePasswordsTest::SetupAutomaticPassword() { 62 void ManagePasswordsTest::SetupAutomaticPassword() {
63 password_manager::StubPasswordManagerClient client; 63 password_manager::StubPasswordManagerClient client;
64 password_manager::StubPasswordManagerDriver driver; 64 password_manager::StubPasswordManagerDriver driver;
65 scoped_ptr<password_manager::PasswordFormManager> test_form_manager( 65 scoped_ptr<password_manager::PasswordFormManager> test_form_manager(
66 new password_manager::PasswordFormManager( 66 new password_manager::PasswordFormManager(
67 NULL, &client, driver.AsWeakPtr(), *test_form(), false)); 67 NULL, &client, driver.AsWeakPtr(), *test_form(), false));
68 GetController()->OnAutomaticPasswordSave(test_form_manager.Pass()); 68 GetController()->OnAutomaticPasswordSave(test_form_manager.Pass());
69 } 69 }
70 70
71 void ManagePasswordsTest::SetupBlackistedPassword() { 71 void ManagePasswordsTest::SetupBlackistedPassword() {
72 base::string16 kTestUsername = base::ASCIIToUTF16("test_username"); 72 test_form()->blacklisted_by_user = true;
73 test_form()->username_value.clear();
73 autofill::PasswordFormMap map; 74 autofill::PasswordFormMap map;
74 map[kTestUsername] = test_form(); 75 map[test_form()->username_value] = test_form();
75 GetController()->OnBlacklistBlockedAutofill(map); 76 GetController()->OnBlacklistBlockedAutofill(map);
76 } 77 }
77 78
78 void ManagePasswordsTest::SetupChooseCredentials( 79 void ManagePasswordsTest::SetupChooseCredentials(
79 ScopedVector<autofill::PasswordForm> local_credentials, 80 ScopedVector<autofill::PasswordForm> local_credentials,
80 ScopedVector<autofill::PasswordForm> federated_credentials, 81 ScopedVector<autofill::PasswordForm> federated_credentials,
81 const GURL& origin) { 82 const GURL& origin) {
82 base::string16 kTestUsername = base::ASCIIToUTF16("test_username"); 83 base::string16 kTestUsername = base::ASCIIToUTF16("test_username");
83 autofill::PasswordFormMap map; 84 autofill::PasswordFormMap map;
84 map[kTestUsername] = test_form(); 85 map[kTestUsername] = test_form();
(...skipping 12 matching lines...) Expand all
97 // Ensure that everything has been properly recorded before pulling samples. 98 // Ensure that everything has been properly recorded before pulling samples.
98 content::RunAllPendingInMessageLoop(); 99 content::RunAllPendingInMessageLoop();
99 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram) 100 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram)
100 .release(); 101 .release();
101 } 102 }
102 103
103 ManagePasswordsUIController* ManagePasswordsTest::GetController() { 104 ManagePasswordsUIController* ManagePasswordsTest::GetController() {
104 return ManagePasswordsUIController::FromWebContents( 105 return ManagePasswordsUIController::FromWebContents(
105 browser()->tab_strip_model()->GetActiveWebContents()); 106 browser()->tab_strip_model()->GetActiveWebContents());
106 } 107 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698