OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 source_profile.importer_type = importer::TYPE_FIREFOX3; | 421 source_profile.importer_type = importer::TYPE_FIREFOX3; |
422 source_profile.app_path = app_path_; | 422 source_profile.app_path = app_path_; |
423 source_profile.source_path = profile_path_; | 423 source_profile.source_path = profile_path_; |
424 scoped_refptr<ImporterHost> host(new ImporterHost); | 424 scoped_refptr<ImporterHost> host(new ImporterHost); |
425 host->SetObserver(observer); | 425 host->SetObserver(observer); |
426 int items = importer::HISTORY | importer::PASSWORDS | importer::FAVORITES; | 426 int items = importer::HISTORY | importer::PASSWORDS | importer::FAVORITES; |
427 if (import_search_plugins) | 427 if (import_search_plugins) |
428 items = items | importer::SEARCH_ENGINES; | 428 items = items | importer::SEARCH_ENGINES; |
429 loop->PostTask(FROM_HERE, base::Bind( | 429 loop->PostTask(FROM_HERE, base::Bind( |
430 &ImporterHost::StartImportSettings, host.get(), source_profile, | 430 &ImporterHost::StartImportSettings, host.get(), source_profile, |
431 profile_.get(), items, make_scoped_refptr(writer), true)); | 431 profile_.get(), items, make_scoped_refptr(writer))); |
432 loop->Run(); | 432 loop->Run(); |
433 } | 433 } |
434 | 434 |
435 base::FilePath profile_path_; | 435 base::FilePath profile_path_; |
436 base::FilePath app_path_; | 436 base::FilePath app_path_; |
437 }; | 437 }; |
438 | 438 |
439 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox2Importer)) { | 439 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox2Importer)) { |
440 base::FilePath data_path; | 440 base::FilePath data_path; |
441 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 441 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
(...skipping 24 matching lines...) Expand all Loading... |
466 source_profile.app_path = app_path_; | 466 source_profile.app_path = app_path_; |
467 source_profile.source_path = profile_path_; | 467 source_profile.source_path = profile_path_; |
468 | 468 |
469 loop->PostTask(FROM_HERE, base::Bind( | 469 loop->PostTask(FROM_HERE, base::Bind( |
470 &ImporterHost::StartImportSettings, | 470 &ImporterHost::StartImportSettings, |
471 host.get(), | 471 host.get(), |
472 source_profile, | 472 source_profile, |
473 profile_.get(), | 473 profile_.get(), |
474 importer::HISTORY | importer::PASSWORDS | | 474 importer::HISTORY | importer::PASSWORDS | |
475 importer::FAVORITES | importer::SEARCH_ENGINES, | 475 importer::FAVORITES | importer::SEARCH_ENGINES, |
476 make_scoped_refptr(observer), | 476 make_scoped_refptr(observer))); |
477 true)); | |
478 loop->Run(); | 477 loop->Run(); |
479 } | 478 } |
480 | 479 |
481 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox30Importer)) { | 480 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox30Importer)) { |
482 scoped_refptr<Firefox3Observer> observer(new Firefox3Observer()); | 481 scoped_refptr<Firefox3Observer> observer(new Firefox3Observer()); |
483 Firefox3xImporterTest("firefox3_profile", observer.get(), observer.get(), | 482 Firefox3xImporterTest("firefox3_profile", observer.get(), observer.get(), |
484 true); | 483 true); |
485 } | 484 } |
486 | 485 |
487 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox35Importer)) { | 486 TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox35Importer)) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 EXPECT_EQ("http://www.tamurayukari.com/", entry.url.spec()); | 764 EXPECT_EQ("http://www.tamurayukari.com/", entry.url.spec()); |
766 EXPECT_EQ(0U, entry.path.size()); | 765 EXPECT_EQ(0U, entry.path.size()); |
767 entry = *it++; | 766 entry = *it++; |
768 EXPECT_EQ(ASCIIToUTF16("Google"), entry.title); | 767 EXPECT_EQ(ASCIIToUTF16("Google"), entry.title); |
769 EXPECT_EQ("http://www.google.com/", entry.url.spec()); | 768 EXPECT_EQ("http://www.google.com/", entry.url.spec()); |
770 EXPECT_EQ(0U, entry.path.size()); | 769 EXPECT_EQ(0U, entry.path.size()); |
771 } | 770 } |
772 | 771 |
773 importer->Release(); | 772 importer->Release(); |
774 } | 773 } |
OLD | NEW |