| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <unknwn.h> | 9 #include <unknwn.h> |
| 10 #include <intshcut.h> | 10 #include <intshcut.h> |
| 11 #include <pstore.h> | 11 #include <pstore.h> |
| 12 #include <urlhist.h> | 12 #include <urlhist.h> |
| 13 #include <shlguid.h> | 13 #include <shlguid.h> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "app/win_util.h" |
| 16 #include "base/file_util.h" | 17 #include "base/file_util.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "chrome/browser/importer/ie_importer.h" | 19 #include "chrome/browser/importer/ie_importer.h" |
| 19 #include "chrome/browser/importer/importer.h" | 20 #include "chrome/browser/importer/importer.h" |
| 20 #include "chrome/browser/password_manager/ie7_password.h" | 21 #include "chrome/browser/password_manager/ie7_password.h" |
| 21 #include "chrome/browser/profile.h" | 22 #include "chrome/browser/profile.h" |
| 22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/win_util.h" | |
| 24 | 24 |
| 25 class ImporterTest : public testing::Test { | 25 class ImporterTest : public testing::Test { |
| 26 public: | 26 public: |
| 27 protected: | 27 protected: |
| 28 virtual void SetUp() { | 28 virtual void SetUp() { |
| 29 // Creates a new profile in a new subdirectory in the temp directory. | 29 // Creates a new profile in a new subdirectory in the temp directory. |
| 30 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_path_)); | 30 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_path_)); |
| 31 file_util::AppendToPath(&test_path_, L"ImporterTest"); | 31 file_util::AppendToPath(&test_path_, L"ImporterTest"); |
| 32 file_util::Delete(test_path_, true); | 32 file_util::Delete(test_path_, true); |
| 33 CreateDirectory(test_path_.c_str(), NULL); | 33 CreateDirectory(test_path_.c_str(), NULL); |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 profile_info.app_path = app_path_; | 827 profile_info.app_path = app_path_; |
| 828 profile_info.source_path = profile_path_; | 828 profile_info.source_path = profile_path_; |
| 829 scoped_refptr<ImporterHost> host = new ImporterHost(loop); | 829 scoped_refptr<ImporterHost> host = new ImporterHost(loop); |
| 830 Firefox3Observer* observer = new Firefox3Observer(); | 830 Firefox3Observer* observer = new Firefox3Observer(); |
| 831 host->SetObserver(observer); | 831 host->SetObserver(observer); |
| 832 loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), | 832 loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), |
| 833 &ImporterHost::StartImportSettings, profile_info, | 833 &ImporterHost::StartImportSettings, profile_info, |
| 834 HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, observer, true)); | 834 HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, observer, true)); |
| 835 loop->Run(); | 835 loop->Run(); |
| 836 } | 836 } |
| OLD | NEW |