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

Unified Diff: chrome/browser/importer/firefox_importer_browsertest.cc

Issue 616763002: Importing certain bookmarks from firefox and HTML file as search engines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handled potential NULL pointer exception that could have resulted from CreateTemplateURL. Created 6 years 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
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 2bd2af158afd684d7362b4a87beb7c7f06817694..a4158fc982208f960f5ad69a55db9aec612c4e56 100644
--- a/chrome/browser/importer/firefox_importer_browsertest.cc
+++ b/chrome/browser/importer/firefox_importer_browsertest.cc
@@ -98,6 +98,10 @@ const KeywordInfo kFirefoxKeywords[] = {
"http://www.webster.com/cgi-bin/dictionary?va={searchTerms}"},
// Search keywords.
{L"\x4E2D\x6587", L"\x4E2D\x6587", "http://www.google.com/"},
+ {L"keyword", L"keyword", "http://example.{searchTerms}.com/"},
+ // CreateTemplateURL will return NULL for the following bookmark.
Peter Kasting 2014/12/09 23:10:18 Nit: Since "CreateTemplateURL" doesn't otherwise a
Tapu Ghose 2014/12/10 04:41:55 Done.
+ // Consequently, it won't be imported as search engine.
Peter Kasting 2014/12/09 23:10:18 Nit: as -> as a
Tapu Ghose 2014/12/10 04:41:55 Done. Realized that we may not have any cases tha
Peter Kasting 2014/12/10 17:41:16 We should probably still have the test, as we don'
Tapu Ghose 2014/12/11 03:12:21 Acknowledged.
+ {L"", L"", "http://%x.example.{searchTerms}.com/"},
};
const AutofillFormDataInfo kFirefoxAutofillEntries[] = {
@@ -135,7 +139,11 @@ class FirefoxObserver : public ProfileWriter,
EXPECT_EQ(arraysize(kFirefoxBookmarks), bookmark_count_);
EXPECT_EQ(1U, history_count_);
EXPECT_EQ(arraysize(kFirefoxPasswords), password_count_);
- EXPECT_EQ(arraysize(kFirefoxKeywords), keyword_count_);
+ // The following test case from |kFirefoxKeywords| won't be imported:
+ // "http://%x.example.{searchTerms}.com/"}.
+ // Hence, value of |keyword_count_| should be lower than size of
+ // |kFirefoxKeywords| by 1.
+ EXPECT_EQ(arraysize(kFirefoxKeywords) - 1, keyword_count_);
}
bool BookmarkModelIsLoaded() const override {

Powered by Google App Engine
This is Rietveld 408576698