Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/importer/external_process_importer_host.h" | 14 #include "chrome/browser/importer/external_process_importer_host.h" |
| 15 #include "chrome/browser/importer/importer_progress_observer.h" | 15 #include "chrome/browser/importer/importer_progress_observer.h" |
| 16 #include "chrome/browser/importer/importer_unittest_utils.h" | 16 #include "chrome/browser/importer/importer_unittest_utils.h" |
| 17 #include "chrome/browser/search_engines/template_url.h" | 17 #include "chrome/browser/search_engines/template_url.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/importer/imported_bookmark_entry.h" | 20 #include "chrome/common/importer/imported_bookmark_entry.h" |
| 21 #include "chrome/common/importer/imported_favicon_usage.h" | 21 #include "chrome/common/importer/imported_favicon_usage.h" |
| 22 #include "chrome/common/importer/importer_data_types.h" | 22 #include "chrome/common/importer/importer_data_types.h" |
| 23 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
| 24 #include "components/autofill/core/common/password_form.h" | 24 #include "components/autofill/core/common/password_form.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 | |
| 28 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 | 27 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 |
| 29 #if defined(OS_MACOSX) || (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) | 28 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 30 #define MAYBE_IMPORTER(x) DISABLED_##x | 29 #define MAYBE_IMPORTER(x) DISABLED_##x |
| 31 #else | 30 #else |
| 32 #define MAYBE_IMPORTER(x) x | 31 #define MAYBE_IMPORTER(x) x |
| 33 #endif | 32 #endif |
| 34 | 33 |
| 35 namespace { | 34 namespace { |
| 36 | 35 |
| 37 struct PasswordInfo { | 36 struct PasswordInfo { |
| 38 const char* origin; | 37 const char* origin; |
| 39 const char* action; | 38 const char* action; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 void Firefox3xImporterBrowserTest( | 228 void Firefox3xImporterBrowserTest( |
| 230 std::string profile_dir, | 229 std::string profile_dir, |
| 231 importer::ImporterProgressObserver* observer, | 230 importer::ImporterProgressObserver* observer, |
| 232 ProfileWriter* writer, | 231 ProfileWriter* writer, |
| 233 bool import_search_plugins) { | 232 bool import_search_plugins) { |
| 234 base::FilePath data_path; | 233 base::FilePath data_path; |
| 235 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 234 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
| 236 data_path = data_path.AppendASCII(profile_dir); | 235 data_path = data_path.AppendASCII(profile_dir); |
| 237 ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, true)); | 236 ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, true)); |
| 238 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 237 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
| 238 #if defined(OS_MACOSX) | |
| 239 data_path = data_path.AppendASCII("firefox3_nss_mac"); | |
|
jeremy
2013/12/17 11:48:09
I think this needs to be part of the CL as well?
mpawlowski
2013/12/17 12:31:25
Added a sentence in the CL.
| |
| 240 #else | |
| 239 data_path = data_path.AppendASCII("firefox3_nss"); | 241 data_path = data_path.AppendASCII("firefox3_nss"); |
| 242 #endif | |
| 240 ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, false)); | 243 ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, false)); |
| 241 | 244 |
| 242 base::FilePath search_engine_path = app_path_; | 245 base::FilePath search_engine_path = app_path_; |
| 243 search_engine_path = search_engine_path.AppendASCII("searchplugins"); | 246 search_engine_path = search_engine_path.AppendASCII("searchplugins"); |
| 244 base::CreateDirectory(search_engine_path); | 247 base::CreateDirectory(search_engine_path); |
| 245 if (import_search_plugins) { | 248 if (import_search_plugins) { |
| 246 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 249 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
| 247 data_path = data_path.AppendASCII("firefox3_searchplugins"); | 250 data_path = data_path.AppendASCII("firefox3_searchplugins"); |
| 248 if (!base::PathExists(data_path)) { | 251 if (!base::PathExists(data_path)) { |
| 249 // TODO(maruel): Create search test data that we can open source! | 252 // TODO(maruel): Create search test data that we can open source! |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 } | 289 } |
| 287 | 290 |
| 288 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, | 291 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, |
| 289 MAYBE_IMPORTER(Firefox35Importer)) { | 292 MAYBE_IMPORTER(Firefox35Importer)) { |
| 290 bool import_search_engines = false; | 293 bool import_search_engines = false; |
| 291 scoped_refptr<FirefoxObserver> observer( | 294 scoped_refptr<FirefoxObserver> observer( |
| 292 new FirefoxObserver(import_search_engines)); | 295 new FirefoxObserver(import_search_engines)); |
| 293 Firefox3xImporterBrowserTest("firefox35_profile", observer.get(), | 296 Firefox3xImporterBrowserTest("firefox35_profile", observer.get(), |
| 294 observer.get(), import_search_engines); | 297 observer.get(), import_search_engines); |
| 295 } | 298 } |
| OLD | NEW |