OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 // The order of these includes is important. | 8 // The order of these includes is important. |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <unknwn.h> | 10 #include <unknwn.h> |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 history::VisitSource visit_source) { | 231 history::VisitSource visit_source) { |
232 // Importer should read the specified URL. | 232 // Importer should read the specified URL. |
233 for (size_t i = 0; i < page.size(); ++i) { | 233 for (size_t i = 0; i < page.size(); ++i) { |
234 if (page[i].title() == kIEIdentifyTitle && | 234 if (page[i].title() == kIEIdentifyTitle && |
235 page[i].url() == GURL(kIEIdentifyUrl)) | 235 page[i].url() == GURL(kIEIdentifyUrl)) |
236 ++history_count_; | 236 ++history_count_; |
237 } | 237 } |
238 EXPECT_EQ(history::SOURCE_IE_IMPORTED, visit_source); | 238 EXPECT_EQ(history::SOURCE_IE_IMPORTED, visit_source); |
239 } | 239 } |
240 | 240 |
241 virtual void AddBookmarkEntry(const std::vector<BookmarkEntry>& bookmark, | 241 virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark, |
242 const string16& first_folder_name, | 242 const string16& first_folder_name, |
243 int options) { | 243 int options) OVERRIDE { |
244 // Importer should import the IE Favorites folder the same as the list. | 244 // Importer should import the IE Favorites folder the same as the list. |
245 for (size_t i = 0; i < bookmark.size(); ++i) { | 245 for (size_t i = 0; i < bookmark.size(); ++i) { |
246 if (FindBookmarkEntry(bookmark[i], kIEBookmarks, | 246 if (FindBookmarkEntry(bookmark[i], kIEBookmarks, |
247 arraysize(kIEBookmarks))) | 247 arraysize(kIEBookmarks))) |
248 ++bookmark_count_; | 248 ++bookmark_count_; |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 virtual void AddKeyword(std::vector<TemplateURL*> template_url, | 252 virtual void AddKeyword(std::vector<TemplateURL*> template_url, |
253 int default_keyword_index) { | 253 int default_keyword_index) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 597 |
598 virtual void AddHistoryPage(const std::vector<history::URLRow>& page, | 598 virtual void AddHistoryPage(const std::vector<history::URLRow>& page, |
599 history::VisitSource visit_source) { | 599 history::VisitSource visit_source) { |
600 ASSERT_EQ(1U, page.size()); | 600 ASSERT_EQ(1U, page.size()); |
601 EXPECT_EQ("http://en-us.www.mozilla.com/", page[0].url().spec()); | 601 EXPECT_EQ("http://en-us.www.mozilla.com/", page[0].url().spec()); |
602 EXPECT_EQ(ASCIIToUTF16("Firefox Updated"), page[0].title()); | 602 EXPECT_EQ(ASCIIToUTF16("Firefox Updated"), page[0].title()); |
603 EXPECT_EQ(history::SOURCE_FIREFOX_IMPORTED, visit_source); | 603 EXPECT_EQ(history::SOURCE_FIREFOX_IMPORTED, visit_source); |
604 ++history_count_; | 604 ++history_count_; |
605 } | 605 } |
606 | 606 |
607 virtual void AddBookmarkEntry(const std::vector<BookmarkEntry>& bookmark, | 607 virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark, |
608 const string16& first_folder_name, | 608 const string16& first_folder_name, |
609 int options) { | 609 int options) OVERRIDE { |
610 for (size_t i = 0; i < bookmark.size(); ++i) { | 610 for (size_t i = 0; i < bookmark.size(); ++i) { |
611 if (FindBookmarkEntry(bookmark[i], kFirefox2Bookmarks, | 611 if (FindBookmarkEntry(bookmark[i], kFirefox2Bookmarks, |
612 arraysize(kFirefox2Bookmarks))) | 612 arraysize(kFirefox2Bookmarks))) |
613 ++bookmark_count_; | 613 ++bookmark_count_; |
614 } | 614 } |
615 } | 615 } |
616 | 616 |
617 virtual void AddKeywords(const std::vector<TemplateURL*>& template_urls, | 617 virtual void AddKeywords(const std::vector<TemplateURL*>& template_urls, |
618 int default_keyword_index, | 618 int default_keyword_index, |
619 bool unique_on_host_and_path) { | 619 bool unique_on_host_and_path) { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 EXPECT_EQ(ASCIIToUTF16("Google"), page[0].title()); | 807 EXPECT_EQ(ASCIIToUTF16("Google"), page[0].title()); |
808 EXPECT_EQ("http://www.google.com/", page[1].url().spec()); | 808 EXPECT_EQ("http://www.google.com/", page[1].url().spec()); |
809 EXPECT_EQ(ASCIIToUTF16("Google"), page[1].title()); | 809 EXPECT_EQ(ASCIIToUTF16("Google"), page[1].title()); |
810 EXPECT_EQ("http://www.cs.unc.edu/~jbs/resources/perl/perl-cgi/programs/form1
-POST.html", | 810 EXPECT_EQ("http://www.cs.unc.edu/~jbs/resources/perl/perl-cgi/programs/form1
-POST.html", |
811 page[2].url().spec()); | 811 page[2].url().spec()); |
812 EXPECT_EQ(ASCIIToUTF16("example form (POST)"), page[2].title()); | 812 EXPECT_EQ(ASCIIToUTF16("example form (POST)"), page[2].title()); |
813 EXPECT_EQ(history::SOURCE_FIREFOX_IMPORTED, visit_source); | 813 EXPECT_EQ(history::SOURCE_FIREFOX_IMPORTED, visit_source); |
814 ++history_count_; | 814 ++history_count_; |
815 } | 815 } |
816 | 816 |
817 virtual void AddBookmarkEntry(const std::vector<BookmarkEntry>& bookmark, | 817 virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark, |
818 const string16& first_folder_name, | 818 const string16& first_folder_name, |
819 int options) { | 819 int options) OVERRIDE { |
820 for (size_t i = 0; i < bookmark.size(); ++i) { | 820 for (size_t i = 0; i < bookmark.size(); ++i) { |
821 if (FindBookmarkEntry(bookmark[i], kFirefox3Bookmarks, | 821 if (FindBookmarkEntry(bookmark[i], kFirefox3Bookmarks, |
822 arraysize(kFirefox3Bookmarks))) | 822 arraysize(kFirefox3Bookmarks))) |
823 ++bookmark_count_; | 823 ++bookmark_count_; |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 void AddKeywords(const std::vector<TemplateURL*>& template_urls, | 827 void AddKeywords(const std::vector<TemplateURL*>& template_urls, |
828 int default_keyword_index, | 828 int default_keyword_index, |
829 bool unique_on_host_and_path) { | 829 bool unique_on_host_and_path) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 true); | 875 true); |
876 } | 876 } |
877 | 877 |
878 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { | 878 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { |
879 bool import_search_engines = false; | 879 bool import_search_engines = false; |
880 scoped_refptr<Firefox3Observer> observer( | 880 scoped_refptr<Firefox3Observer> observer( |
881 new Firefox3Observer(import_search_engines)); | 881 new Firefox3Observer(import_search_engines)); |
882 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), | 882 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), |
883 import_search_engines); | 883 import_search_engines); |
884 } | 884 } |
OLD | NEW |