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

Side by Side Diff: chrome/browser/autofill/password_autofill_manager_unittest.cc

Issue 10230005: New Autofill UI uses ID for password (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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/autofill/password_autofill_manager.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 (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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/autofill/password_autofill_manager.h" 7 #include "chrome/browser/autofill/password_autofill_manager.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace { 10 namespace {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 webkit::forms::FormField invalid_username_field; 65 webkit::forms::FormField invalid_username_field;
66 invalid_username_field.name = ASCIIToUTF16(kInvalidUsername); 66 invalid_username_field.name = ASCIIToUTF16(kInvalidUsername);
67 67
68 EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( 68 EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion(
69 invalid_username_field, ASCIIToUTF16(kAliceUsername))); 69 invalid_username_field, ASCIIToUTF16(kAliceUsername)));
70 70
71 password_autofill_manager()->Reset(); 71 password_autofill_manager()->Reset();
72 EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( 72 EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion(
73 username_field(), ASCIIToUTF16(kAliceUsername))); 73 username_field(), ASCIIToUTF16(kAliceUsername)));
74 } 74 }
75
76 TEST_F(PasswordAutofillManagerTest, DidSelectAutofillSuggestion) {
77 EXPECT_TRUE(password_autofill_manager()->DidSelectAutofillSuggestion(
78 username_field()));
79
80 password_autofill_manager()->Reset();
81
82 EXPECT_FALSE(password_autofill_manager()->DidSelectAutofillSuggestion(
83 username_field()));
84 }
85
86 TEST_F(PasswordAutofillManagerTest, DidClearAutofillSelection) {
87 EXPECT_TRUE(password_autofill_manager()->DidClearAutofillSelection(
88 username_field()));
89
90 password_autofill_manager()->Reset();
91
92 EXPECT_FALSE(password_autofill_manager()->DidClearAutofillSelection(
93 username_field()));
94 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/password_autofill_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698