Chromium Code Reviews| 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 13d2d377a24e3fff92a4725297a03d47bdda6415..270b151e54b74b4901997d9962fb7f83506ac843 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,11 @@ const KeywordInfo kFirefoxKeywords[] = { |
| {L"\x4E2D\x6587", L"\x4E2D\x6587", "http://www.google.com/"}, |
| }; |
| +const AutofillFormDataInfo kFirefoxAutofill[] = { |
|
Ilya Sherman
2014/08/20 05:47:41
nit: "kFirefoxAutofillEntries"
Nikhil
2014/08/20 11:29:16
Done.
|
| + {"name", "user_one"}, |
| + {"n300", "user_two"}, |
|
Ilya Sherman
2014/08/20 05:47:41
Please include additional cases: case sensitivity,
Nikhil
2014/08/20 11:29:16
I'm going to add these in next revision of this CL
|
| +}; |
| + |
| class FirefoxObserver : public ProfileWriter, |
| public importer::ImporterProgressObserver { |
| public: |
| @@ -167,6 +178,17 @@ class FirefoxObserver : public ProfileWriter, |
| } |
| } |
| + virtual void AddAutofillFormDataEntries( |
| + const std::vector<autofill::AutofillEntry>& autofill_entries) OVERRIDE { |
| + EXPECT_EQ(arraysize(kFirefoxAutofill), autofill_entries.size()); |
| + for (size_t i = 0; i < arraysize(kFirefoxAutofill); ++i) { |
| + EXPECT_EQ(kFirefoxAutofill[i].name, |
| + base::UTF16ToUTF8(autofill_entries[i].key().name())); |
| + EXPECT_EQ(kFirefoxAutofill[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 +293,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; |