Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: trunk/src/chrome/browser/importer/ie_importer_browsertest_win.cc

Issue 15876003: Revert 201968 "Revert 201837 "OOP import on Windows."" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <shlguid.h> 9 #include <shlguid.h>
10 #include <urlhist.h> 10 #include <urlhist.h>
(...skipping 12 matching lines...) Expand all
23 #include "base/stl_util.h" 23 #include "base/stl_util.h"
24 #include "base/string16.h" 24 #include "base/string16.h"
25 #include "base/string_util.h" 25 #include "base/string_util.h"
26 #include "base/utf_string_conversions.h" 26 #include "base/utf_string_conversions.h"
27 #include "base/win/registry.h" 27 #include "base/win/registry.h"
28 #include "base/win/scoped_comptr.h" 28 #include "base/win/scoped_comptr.h"
29 #include "base/win/scoped_propvariant.h" 29 #include "base/win/scoped_propvariant.h"
30 #include "base/win/windows_version.h" 30 #include "base/win/windows_version.h"
31 #include "chrome/browser/bookmarks/imported_bookmark_entry.h" 31 #include "chrome/browser/bookmarks/imported_bookmark_entry.h"
32 #include "chrome/browser/favicon/imported_favicon_usage.h" 32 #include "chrome/browser/favicon/imported_favicon_usage.h"
33 #include "chrome/browser/importer/external_process_importer_host.h"
33 #include "chrome/browser/importer/ie_importer.h" 34 #include "chrome/browser/importer/ie_importer.h"
34 #include "chrome/browser/importer/ie_importer_utils_win.h" 35 #include "chrome/browser/importer/ie_importer_utils_win.h"
35 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" 36 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h"
36 #include "chrome/browser/importer/importer_bridge.h" 37 #include "chrome/browser/importer/importer_bridge.h"
37 #include "chrome/browser/importer/importer_data_types.h" 38 #include "chrome/browser/importer/importer_data_types.h"
38 #include "chrome/browser/importer/importer_host.h" 39 #include "chrome/browser/importer/importer_host.h"
39 #include "chrome/browser/importer/importer_progress_observer.h" 40 #include "chrome/browser/importer/importer_progress_observer.h"
40 #include "chrome/browser/importer/importer_unittest_utils.h" 41 #include "chrome/browser/importer/importer_unittest_utils.h"
41 #include "chrome/browser/importer/pstore_declarations.h" 42 #include "chrome/browser/importer/pstore_declarations.h"
42 #include "chrome/browser/search_engines/template_url.h" 43 #include "chrome/browser/search_engines/template_url.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // Sets up a special history link. 478 // Sets up a special history link.
478 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; 479 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2;
479 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, 480 res = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL,
480 CLSCTX_INPROC_SERVER); 481 CLSCTX_INPROC_SERVER);
481 ASSERT_TRUE(res == S_OK); 482 ASSERT_TRUE(res == S_OK);
482 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0); 483 res = url_history_stg2->AddUrl(kIEIdentifyUrl, kIEIdentifyTitle, 0);
483 ASSERT_TRUE(res == S_OK); 484 ASSERT_TRUE(res == S_OK);
484 485
485 // Starts to import the above settings. 486 // Starts to import the above settings.
486 // Deletes itself. 487 // Deletes itself.
487 // TODO(gab): Use ExternalProcessImporterHost on Windows. 488 ImporterHost* host = new ExternalProcessImporterHost;
488 ImporterHost* host = new ImporterHost;
489 TestObserver* observer = new TestObserver(); 489 TestObserver* observer = new TestObserver();
490 host->SetObserver(observer); 490 host->SetObserver(observer);
491 491
492 importer::SourceProfile source_profile; 492 importer::SourceProfile source_profile;
493 source_profile.importer_type = importer::TYPE_IE; 493 source_profile.importer_type = importer::TYPE_IE;
494 source_profile.source_path = temp_dir_.path(); 494 source_profile.source_path = temp_dir_.path();
495 495
496 host->StartImportSettings( 496 host->StartImportSettings(
497 source_profile, 497 source_profile,
498 browser()->profile(), 498 browser()->profile(),
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 base::string16 key_path(importer::GetIEFavoritesOrderKey()); 554 base::string16 key_path(importer::GetIEFavoritesOrderKey());
555 base::win::RegKey key; 555 base::win::RegKey key;
556 ASSERT_EQ(ERROR_SUCCESS, 556 ASSERT_EQ(ERROR_SUCCESS,
557 key.Create(HKEY_CURRENT_USER, key_path.c_str(), KEY_WRITE)); 557 key.Create(HKEY_CURRENT_USER, key_path.c_str(), KEY_WRITE));
558 ASSERT_EQ(ERROR_SUCCESS, 558 ASSERT_EQ(ERROR_SUCCESS,
559 key.WriteValue(L"Order", kBadBinary[i].data, kBadBinary[i].length, 559 key.WriteValue(L"Order", kBadBinary[i].data, kBadBinary[i].length,
560 REG_BINARY)); 560 REG_BINARY));
561 561
562 // Starts to import the above settings. 562 // Starts to import the above settings.
563 // Deletes itself. 563 // Deletes itself.
564 // TODO(gab): Use ExternalProcessImporterHost on Windows. 564 ImporterHost* host = new ExternalProcessImporterHost;
565 ImporterHost* host = new ImporterHost;
566 MalformedFavoritesRegistryTestObserver* observer = 565 MalformedFavoritesRegistryTestObserver* observer =
567 new MalformedFavoritesRegistryTestObserver(); 566 new MalformedFavoritesRegistryTestObserver();
568 host->SetObserver(observer); 567 host->SetObserver(observer);
569 568
570 importer::SourceProfile source_profile; 569 importer::SourceProfile source_profile;
571 source_profile.importer_type = importer::TYPE_IE; 570 source_profile.importer_type = importer::TYPE_IE;
572 source_profile.source_path = temp_dir_.path(); 571 source_profile.source_path = temp_dir_.path();
573 572
574 host->StartImportSettings( 573 host->StartImportSettings(
575 source_profile, 574 source_profile,
576 browser()->profile(), 575 browser()->profile(),
577 importer::FAVORITES, 576 importer::FAVORITES,
578 observer); 577 observer);
579 MessageLoop::current()->Run(); 578 MessageLoop::current()->Run();
580 } 579 }
581 } 580 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698