| Index: chrome/browser/importer/firefox_importer_browsertest.cc
|
| diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc
|
| index 8ae0237a457cb76a7924889700151eac84c2f29e..3df0e4e4d713f79bac54c809a9b69d906d1194ed 100644
|
| --- a/chrome/browser/importer/firefox_importer_browsertest.cc
|
| +++ b/chrome/browser/importer/firefox_importer_browsertest.cc
|
| @@ -20,6 +20,7 @@
|
| #include "chrome/common/importer/imported_favicon_usage.h"
|
| #include "chrome/common/importer/importer_data_types.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| +#include "components/autofill/core/browser/webdata/autofill_entry.h"
|
| #include "components/autofill/core/common/password_form.h"
|
| #include "components/search_engines/template_url.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -51,6 +52,11 @@ struct KeywordInfo {
|
| const char* url;
|
| };
|
|
|
| +struct AutofillFormDataInfo {
|
| + const char* name;
|
| + const char* value;
|
| +};
|
| +
|
| const BookmarkInfo kFirefoxBookmarks[] = {
|
| {true, 1, {"Bookmarks Toolbar"},
|
| L"Toolbar",
|
| @@ -94,6 +100,21 @@ const KeywordInfo kFirefoxKeywords[] = {
|
| {L"\x4E2D\x6587", L"\x4E2D\x6587", "http://www.google.com/"},
|
| };
|
|
|
| +const AutofillFormDataInfo kFirefoxAutofillEntries[] = {
|
| + {"name", "John"},
|
| + {"address", "#123 Cherry Ave"},
|
| + {"city", "Mountain View"},
|
| + {"zip", "94043"},
|
| + {"n300", "+1 (408) 871-4567"},
|
| + {"name", "john"},
|
| + {"name", "aguantó"},
|
| + {"address", "télévision@example.com"},
|
| + {"city", "&$%$$$ TESTO *&*&^&^& MOKO"},
|
| + {"zip", "WOHOOOO$$$$$$$$****"},
|
| + {"n300", "\xe0\xa4\x9f\xe2\x97\x8c\xe0\xa4\xbe\xe0\xa4\xaf\xe0\xa4\xb0"},
|
| + {"n300", "\xe4\xbb\xa5\xe7\x8e\xa9\xe4\xb8\xba\xe4\xb8\xbb"}
|
| +};
|
| +
|
| class FirefoxObserver : public ProfileWriter,
|
| public importer::ImporterProgressObserver {
|
| public:
|
| @@ -167,6 +188,17 @@ class FirefoxObserver : public ProfileWriter,
|
| }
|
| }
|
|
|
| + virtual void AddAutofillFormDataEntries(
|
| + const std::vector<autofill::AutofillEntry>& autofill_entries) OVERRIDE {
|
| + EXPECT_EQ(arraysize(kFirefoxAutofillEntries), autofill_entries.size());
|
| + for (size_t i = 0; i < arraysize(kFirefoxAutofillEntries); ++i) {
|
| + EXPECT_EQ(kFirefoxAutofillEntries[i].name,
|
| + base::UTF16ToUTF8(autofill_entries[i].key().name()));
|
| + EXPECT_EQ(kFirefoxAutofillEntries[i].value,
|
| + base::UTF16ToUTF8(autofill_entries[i].key().value()));
|
| + }
|
| + }
|
| +
|
| virtual void AddKeywords(ScopedVector<TemplateURL> template_urls,
|
| bool unique_on_host_and_path) OVERRIDE {
|
| for (size_t i = 0; i < template_urls.size(); ++i) {
|
| @@ -271,7 +303,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest {
|
| source_profile.locale = "en-US";
|
|
|
| int items = importer::HISTORY | importer::PASSWORDS | importer::FAVORITES |
|
| - importer::SEARCH_ENGINES;
|
| + importer::SEARCH_ENGINES | importer::AUTOFILL_FORM_DATA;
|
|
|
| // Deletes itself.
|
| ExternalProcessImporterHost* host = new ExternalProcessImporterHost;
|
|
|