| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/run_loop.h" |
| 13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 18 #include "chrome/browser/importer/external_process_importer_host.h" | 19 #include "chrome/browser/importer/external_process_importer_host.h" |
| 19 #include "chrome/browser/importer/importer_progress_observer.h" | 20 #include "chrome/browser/importer/importer_progress_observer.h" |
| 20 #include "chrome/browser/importer/importer_unittest_utils.h" | 21 #include "chrome/browser/importer/importer_unittest_utils.h" |
| 21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 source_profile.locale = "en-US"; | 321 source_profile.locale = "en-US"; |
| 321 | 322 |
| 322 int items = importer::HISTORY | importer::PASSWORDS | importer::FAVORITES | | 323 int items = importer::HISTORY | importer::PASSWORDS | importer::FAVORITES | |
| 323 importer::SEARCH_ENGINES | importer::AUTOFILL_FORM_DATA; | 324 importer::SEARCH_ENGINES | importer::AUTOFILL_FORM_DATA; |
| 324 | 325 |
| 325 // Deletes itself. | 326 // Deletes itself. |
| 326 ExternalProcessImporterHost* host = new ExternalProcessImporterHost; | 327 ExternalProcessImporterHost* host = new ExternalProcessImporterHost; |
| 327 host->set_observer(observer); | 328 host->set_observer(observer); |
| 328 host->StartImportSettings( | 329 host->StartImportSettings( |
| 329 source_profile, browser()->profile(), items, writer); | 330 source_profile, browser()->profile(), items, writer); |
| 330 base::MessageLoop::current()->Run(); | 331 base::RunLoop().Run(); |
| 331 } | 332 } |
| 332 | 333 |
| 333 base::ScopedTempDir temp_dir_; | 334 base::ScopedTempDir temp_dir_; |
| 334 base::FilePath profile_path_; | 335 base::FilePath profile_path_; |
| 335 base::FilePath app_path_; | 336 base::FilePath app_path_; |
| 336 }; | 337 }; |
| 337 | 338 |
| 338 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, | 339 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, |
| 339 MAYBE_IMPORTER(Firefox30Importer)) { | 340 MAYBE_IMPORTER(Firefox30Importer)) { |
| 340 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(false)); | 341 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(false)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 354 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); | 355 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); |
| 355 FirefoxImporterBrowserTest("firefox_profile", observer.get(), observer.get()); | 356 FirefoxImporterBrowserTest("firefox_profile", observer.get(), observer.get()); |
| 356 } | 357 } |
| 357 | 358 |
| 358 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, | 359 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, |
| 359 MAYBE_IMPORTER(Firefox320Importer)) { | 360 MAYBE_IMPORTER(Firefox320Importer)) { |
| 360 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); | 361 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); |
| 361 FirefoxImporterBrowserTest("firefox320_profile", observer.get(), | 362 FirefoxImporterBrowserTest("firefox320_profile", observer.get(), |
| 362 observer.get()); | 363 observer.get()); |
| 363 } | 364 } |
| OLD | NEW |