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 // The order of these includes is important. | 5 // The order of these includes is important. |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <unknwn.h> | 7 #include <unknwn.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <propvarutil.h> | 9 #include <propvarutil.h> |
10 #include <shlguid.h> | 10 #include <shlguid.h> |
11 #include <shlobj.h> | 11 #include <shlobj.h> |
12 #include <stddef.h> | 12 #include <stddef.h> |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 #include <urlhist.h> | 14 #include <urlhist.h> |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/bind.h" | 19 #include "base/bind.h" |
20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
21 #include "base/files/file_util.h" | 21 #include "base/files/file_util.h" |
22 #include "base/files/scoped_temp_dir.h" | 22 #include "base/files/scoped_temp_dir.h" |
23 #include "base/macros.h" | 23 #include "base/macros.h" |
| 24 #include "base/memory/ptr_util.h" |
24 #include "base/message_loop/message_loop.h" | 25 #include "base/message_loop/message_loop.h" |
25 #include "base/run_loop.h" | 26 #include "base/run_loop.h" |
26 #include "base/stl_util.h" | |
27 #include "base/strings/string16.h" | 27 #include "base/strings/string16.h" |
28 #include "base/strings/string_util.h" | 28 #include "base/strings/string_util.h" |
29 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
30 #include "base/win/registry.h" | 30 #include "base/win/registry.h" |
31 #include "base/win/scoped_comptr.h" | 31 #include "base/win/scoped_comptr.h" |
32 #include "base/win/scoped_propvariant.h" | 32 #include "base/win/scoped_propvariant.h" |
33 #include "base/win/windows_version.h" | 33 #include "base/win/windows_version.h" |
34 #include "chrome/browser/importer/external_process_importer_host.h" | 34 #include "chrome/browser/importer/external_process_importer_host.h" |
35 #include "chrome/browser/importer/importer_progress_observer.h" | 35 #include "chrome/browser/importer/importer_progress_observer.h" |
36 #include "chrome/browser/importer/importer_unittest_utils.h" | 36 #include "chrome/browser/importer/importer_unittest_utils.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // Importer should import the IE Favorites folder the same as the list, | 311 // Importer should import the IE Favorites folder the same as the list, |
312 // in the same order. | 312 // in the same order. |
313 for (size_t i = 0; i < bookmarks.size(); ++i) { | 313 for (size_t i = 0; i < bookmarks.size(); ++i) { |
314 EXPECT_NO_FATAL_FAILURE( | 314 EXPECT_NO_FATAL_FAILURE( |
315 TestEqualBookmarkEntry(bookmarks[i], | 315 TestEqualBookmarkEntry(bookmarks[i], |
316 kIEBookmarks[bookmark_count_])) << i; | 316 kIEBookmarks[bookmark_count_])) << i; |
317 ++bookmark_count_; | 317 ++bookmark_count_; |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 virtual void AddKeyword(std::vector<TemplateURL*> template_url, | |
322 int default_keyword_index) { | |
323 // TODO(jcampan): bug 1169230: we should test keyword importing for IE. | |
324 // In order to do that we'll probably need to mock the Windows registry. | |
325 NOTREACHED(); | |
326 base::STLDeleteContainerPointers(template_url.begin(), template_url.end()); | |
327 } | |
328 | |
329 void AddFavicons(const favicon_base::FaviconUsageDataList& usage) override { | 321 void AddFavicons(const favicon_base::FaviconUsageDataList& usage) override { |
330 // Importer should group the favicon information for each favicon URL. | 322 // Importer should group the favicon information for each favicon URL. |
331 for (size_t i = 0; i < arraysize(kIEFaviconGroup); ++i) { | 323 for (size_t i = 0; i < arraysize(kIEFaviconGroup); ++i) { |
332 GURL favicon_url(kIEFaviconGroup[i].favicon_url); | 324 GURL favicon_url(kIEFaviconGroup[i].favicon_url); |
333 std::set<GURL> urls; | 325 std::set<GURL> urls; |
334 for (size_t j = 0; j < arraysize(kIEFaviconGroup[i].site_url); ++j) | 326 for (size_t j = 0; j < arraysize(kIEFaviconGroup[i].site_url); ++j) |
335 urls.insert(GURL(kIEFaviconGroup[i].site_url[j])); | 327 urls.insert(GURL(kIEFaviconGroup[i].site_url[j])); |
336 | 328 |
337 SCOPED_TRACE(testing::Message() << "Expected Favicon: " << favicon_url); | 329 SCOPED_TRACE(testing::Message() << "Expected Favicon: " << favicon_url); |
338 | 330 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 source_profile.source_path = temp_dir_.GetPath(); | 641 source_profile.source_path = temp_dir_.GetPath(); |
650 | 642 |
651 host->StartImportSettings( | 643 host->StartImportSettings( |
652 source_profile, | 644 source_profile, |
653 browser()->profile(), | 645 browser()->profile(), |
654 importer::HOME_PAGE, | 646 importer::HOME_PAGE, |
655 observer); | 647 observer); |
656 base::RunLoop().Run(); | 648 base::RunLoop().Run(); |
657 } | 649 } |
658 | 650 |
OLD | NEW |