OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 profile_info.browser_type = FIREFOX3; | 115 profile_info.browser_type = FIREFOX3; |
116 profile_info.app_path = app_path_; | 116 profile_info.app_path = app_path_; |
117 profile_info.source_path = profile_path_; | 117 profile_info.source_path = profile_path_; |
118 scoped_refptr<ImporterHost> host(new ImporterHost()); | 118 scoped_refptr<ImporterHost> host(new ImporterHost()); |
119 host->SetObserver(observer); | 119 host->SetObserver(observer); |
120 int items = HISTORY | PASSWORDS | FAVORITES; | 120 int items = HISTORY | PASSWORDS | FAVORITES; |
121 if (import_search_plugins) | 121 if (import_search_plugins) |
122 items = items | SEARCH_ENGINES; | 122 items = items | SEARCH_ENGINES; |
123 loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), | 123 loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), |
124 &ImporterHost::StartImportSettings, profile_info, | 124 &ImporterHost::StartImportSettings, profile_info, |
125 static_cast<Profile*>(NULL), items, writer, true)); | 125 static_cast<Profile*>(NULL), items, make_scoped_refptr(writer), true)); |
126 loop->Run(); | 126 loop->Run(); |
127 } | 127 } |
128 | 128 |
129 MessageLoopForUI message_loop_; | 129 MessageLoopForUI message_loop_; |
130 BrowserThread ui_thread_; | 130 BrowserThread ui_thread_; |
131 BrowserThread file_thread_; | 131 BrowserThread file_thread_; |
132 FilePath test_path_; | 132 FilePath test_path_; |
133 FilePath profile_path_; | 133 FilePath profile_path_; |
134 FilePath app_path_; | 134 FilePath app_path_; |
135 }; | 135 }; |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 | 698 |
699 MessageLoop* loop = MessageLoop::current(); | 699 MessageLoop* loop = MessageLoop::current(); |
700 scoped_refptr<ImporterHost> host(new ImporterHost()); | 700 scoped_refptr<ImporterHost> host(new ImporterHost()); |
701 FirefoxObserver* observer = new FirefoxObserver(); | 701 FirefoxObserver* observer = new FirefoxObserver(); |
702 host->SetObserver(observer); | 702 host->SetObserver(observer); |
703 ProfileInfo profile_info; | 703 ProfileInfo profile_info; |
704 profile_info.browser_type = FIREFOX2; | 704 profile_info.browser_type = FIREFOX2; |
705 profile_info.app_path = app_path_; | 705 profile_info.app_path = app_path_; |
706 profile_info.source_path = profile_path_; | 706 profile_info.source_path = profile_path_; |
707 | 707 |
708 loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), | 708 loop->PostTask(FROM_HERE, NewRunnableMethod( |
709 &ImporterHost::StartImportSettings, profile_info, | 709 host.get(), |
| 710 &ImporterHost::StartImportSettings, |
| 711 profile_info, |
710 static_cast<Profile*>(NULL), | 712 static_cast<Profile*>(NULL), |
711 HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, observer, true)); | 713 HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, |
| 714 make_scoped_refptr(observer), |
| 715 true)); |
712 loop->Run(); | 716 loop->Run(); |
713 } | 717 } |
714 | 718 |
715 static const BookmarkList kFirefox3Bookmarks[] = { | 719 static const BookmarkList kFirefox3Bookmarks[] = { |
716 {true, 0, {}, | 720 {true, 0, {}, |
717 L"Toolbar", | 721 L"Toolbar", |
718 "http://site/"}, | 722 "http://site/"}, |
719 {false, 0, {}, | 723 {false, 0, {}, |
720 L"Title", | 724 L"Title", |
721 "http://www.google.com/"}, | 725 "http://www.google.com/"}, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 true); | 889 true); |
886 } | 890 } |
887 | 891 |
888 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { | 892 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { |
889 bool import_search_engines = false; | 893 bool import_search_engines = false; |
890 scoped_refptr<Firefox3Observer> observer( | 894 scoped_refptr<Firefox3Observer> observer( |
891 new Firefox3Observer(import_search_engines)); | 895 new Firefox3Observer(import_search_engines)); |
892 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), | 896 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), |
893 import_search_engines); | 897 import_search_engines); |
894 } | 898 } |
OLD | NEW |