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..34993806f953e6e12056beaefc1af6a6066cd2e4 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,15 @@ 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"}, |
|
Ilya Sherman
2014/08/25 23:50:14
I don't see any test cases testing non-ASCII chara
Nikhil
2014/08/26 10:09:33
Added a few more cases. PTAL.
|
| +}; |
| + |
| class FirefoxObserver : public ProfileWriter, |
| public importer::ImporterProgressObserver { |
| public: |
| @@ -167,6 +182,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 +297,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; |