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

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

Issue 1308773002: ManagePasswordsState should ignore the blacklisted forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_state.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/passwords/manage_passwords_state.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_state.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/password_manager/core/browser/password_form_manager.h" 8 #include "components/password_manager/core/browser/password_form_manager.h"
9 #include "components/password_manager/core/browser/stub_password_manager_client. h" 9 #include "components/password_manager/core/browser/stub_password_manager_client. h"
10 #include "components/password_manager/core/common/credential_manager_types.h" 10 #include "components/password_manager/core/common/credential_manager_types.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 EXPECT_NE(GURL::EmptyGURL(), origin); 182 EXPECT_NE(GURL::EmptyGURL(), origin);
183 183
184 // Process the blacklisted form. 184 // Process the blacklisted form.
185 autofill::PasswordForm blacklisted; 185 autofill::PasswordForm blacklisted;
186 blacklisted.blacklisted_by_user = true; 186 blacklisted.blacklisted_by_user = true;
187 blacklisted.origin = origin; 187 blacklisted.origin = origin;
188 password_manager::PasswordStoreChangeList list; 188 password_manager::PasswordStoreChangeList list;
189 list.push_back(password_manager::PasswordStoreChange( 189 list.push_back(password_manager::PasswordStoreChange(
190 password_manager::PasswordStoreChange::ADD, blacklisted)); 190 password_manager::PasswordStoreChange::ADD, blacklisted));
191 passwords_data().ProcessLoginsChanged(list); 191 passwords_data().ProcessLoginsChanged(list);
192 EXPECT_THAT(passwords_data().GetCurrentForms(), 192 EXPECT_EQ(forms, passwords_data().GetCurrentForms());
193 Contains(Pointee(blacklisted)));
194 EXPECT_EQ(federated_forms, passwords_data().federated_credentials_forms()); 193 EXPECT_EQ(federated_forms, passwords_data().federated_credentials_forms());
195 EXPECT_EQ(state, passwords_data().state()); 194 EXPECT_EQ(state, passwords_data().state());
196 EXPECT_EQ(origin, passwords_data().origin()); 195 EXPECT_EQ(origin, passwords_data().origin());
197 196
198 // Delete the blacklisted form. 197 // Delete the blacklisted form.
199 list[0] = password_manager::PasswordStoreChange( 198 list[0] = password_manager::PasswordStoreChange(
200 password_manager::PasswordStoreChange::REMOVE, blacklisted); 199 password_manager::PasswordStoreChange::REMOVE, blacklisted);
201 passwords_data().ProcessLoginsChanged(list); 200 passwords_data().ProcessLoginsChanged(list);
202 EXPECT_EQ(forms, passwords_data().GetCurrentForms()); 201 EXPECT_EQ(forms, passwords_data().GetCurrentForms());
203 EXPECT_EQ(federated_forms, passwords_data().federated_credentials_forms()); 202 EXPECT_EQ(federated_forms, passwords_data().federated_credentials_forms());
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, 480 EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE,
482 passwords_data().state()); 481 passwords_data().state());
483 EXPECT_EQ(test_submitted_form().origin, passwords_data().origin()); 482 EXPECT_EQ(test_submitted_form().origin, passwords_data().origin());
484 ASSERT_TRUE(passwords_data().form_manager()); 483 ASSERT_TRUE(passwords_data().form_manager());
485 EXPECT_EQ(test_submitted_form(), 484 EXPECT_EQ(test_submitted_form(),
486 passwords_data().form_manager()->pending_credentials()); 485 passwords_data().form_manager()->pending_credentials());
487 TestAllUpdates(); 486 TestAllUpdates();
488 } 487 }
489 488
490 } // namespace 489 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698