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

Unified Diff: chrome/browser/autofill/password_autofill_manager_unittest.cc

Issue 12434004: Move remaining Autofill code to //components/autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix long lines Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/password_autofill_manager.cc ('k') | chrome/browser/autofill/password_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/password_autofill_manager_unittest.cc
diff --git a/chrome/browser/autofill/password_autofill_manager_unittest.cc b/chrome/browser/autofill/password_autofill_manager_unittest.cc
deleted file mode 100644
index f7305a78da198bd5b50b6f64d8b66117f3d4fe7b..0000000000000000000000000000000000000000
--- a/chrome/browser/autofill/password_autofill_manager_unittest.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/compiler_specific.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/autofill/password_autofill_manager.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-// The name of the username/password element in the form.
-const char* const kUsernameName = "username";
-const char* const kInvalidUsername = "no-username";
-const char* const kPasswordName = "password";
-
-const char* const kAliceUsername = "alice";
-const char* const kAlicePassword = "password";
-
-const char* const kValue = "password";
-
-} // namespace
-
-class PasswordAutofillManagerTest : public testing::Test {
- protected:
- PasswordAutofillManagerTest() : password_autofill_manager_(NULL) {}
-
- virtual void SetUp() OVERRIDE {
- // Add a preferred login and an additional login to the FillData.
- string16 username1 = ASCIIToUTF16(kAliceUsername);
- string16 password1 = ASCIIToUTF16(kAlicePassword);
-
- username_field_.name = ASCIIToUTF16(kUsernameName);
- username_field_.value = username1;
- fill_data_.basic_data.fields.push_back(username_field_);
-
- FormFieldData password_field;
- password_field.name = ASCIIToUTF16(kPasswordName);
- password_field.value = password1;
- fill_data_.basic_data.fields.push_back(password_field);
-
- password_autofill_manager_.AddPasswordFormMapping(username_field_,
- fill_data_);
- }
-
- PasswordAutofillManager* password_autofill_manager() {
- return &password_autofill_manager_;
- }
-
- const FormFieldData& username_field() { return username_field_; }
-
- private:
- PasswordFormFillData fill_data_;
- FormFieldData username_field_;
-
- PasswordAutofillManager password_autofill_manager_;
-};
-
-TEST_F(PasswordAutofillManagerTest, DidAcceptAutofillSuggestion) {
- EXPECT_TRUE(password_autofill_manager()->DidAcceptAutofillSuggestion(
- username_field(), ASCIIToUTF16(kAliceUsername)));
- EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion(
- username_field(), ASCIIToUTF16(kInvalidUsername)));
-
- FormFieldData invalid_username_field;
- invalid_username_field.name = ASCIIToUTF16(kInvalidUsername);
-
- EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion(
- invalid_username_field, ASCIIToUTF16(kAliceUsername)));
-
- password_autofill_manager()->Reset();
- EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion(
- username_field(), ASCIIToUTF16(kAliceUsername)));
-}
« no previous file with comments | « chrome/browser/autofill/password_autofill_manager.cc ('k') | chrome/browser/autofill/password_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698