// Copyright (c) 2011 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 #include "base/file_util.h" #include "base/path_service.h" #include "base/string_number_conversions.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" #include "chrome/browser/webdata/autofill_table.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/guid.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/forms/form_field.h" using base::Time; using base::TimeDelta; using webkit::forms::FormField; // So we can compare AutofillKeys with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const AutofillKey& key) { return os << UTF16ToASCII(key.name()) << ", " << UTF16ToASCII(key.value()); } // So we can compare AutofillChanges with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const AutofillChange& change) { switch (change.type()) { case AutofillChange::ADD: { os << "ADD"; break; } case AutofillChange::UPDATE: { os << "UPDATE"; break; } case AutofillChange::REMOVE: { os << "REMOVE"; break; } } return os << " " << change.key(); } namespace { bool CompareAutofillEntries(const AutofillEntry& a, const AutofillEntry& b) { std::set