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

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

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 years, 8 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
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 <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/memory/ptr_util.h"
25 #include "base/message_loop/message_loop.h" 25 #include "base/message_loop/message_loop.h"
26 #include "base/run_loop.h" 26 #include "base/run_loop.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/threading/thread_restrictions.h"
30 #include "base/win/registry.h" 31 #include "base/win/registry.h"
31 #include "base/win/scoped_comptr.h" 32 #include "base/win/scoped_comptr.h"
32 #include "base/win/scoped_propvariant.h" 33 #include "base/win/scoped_propvariant.h"
33 #include "base/win/windows_version.h" 34 #include "base/win/windows_version.h"
34 #include "chrome/browser/importer/external_process_importer_host.h" 35 #include "chrome/browser/importer/external_process_importer_host.h"
35 #include "chrome/browser/importer/importer_progress_observer.h" 36 #include "chrome/browser/importer/importer_progress_observer.h"
36 #include "chrome/browser/importer/importer_unittest_utils.h" 37 #include "chrome/browser/importer/importer_unittest_utils.h"
37 #include "chrome/browser/ui/browser.h" 38 #include "chrome/browser/ui/browser.h"
38 #include "chrome/common/chrome_paths.h" 39 #include "chrome/common/chrome_paths.h"
39 #include "chrome/common/importer/ie_importer_utils_win.h" 40 #include "chrome/common/importer/ie_importer_utils_win.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 429 }
429 430
430 base::ScopedTempDir temp_dir_; 431 base::ScopedTempDir temp_dir_;
431 432
432 // Overrides the default registry key for IE registry keys like favorites, 433 // Overrides the default registry key for IE registry keys like favorites,
433 // settings, password store, etc. 434 // settings, password store, etc.
434 ImporterTestRegistryOverrider test_registry_overrider_; 435 ImporterTestRegistryOverrider test_registry_overrider_;
435 }; 436 };
436 437
437 IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) { 438 IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) {
439 base::ThreadRestrictions::ScopedAllowIO allow_io;
438 // Sets up a favorites folder. 440 // Sets up a favorites folder.
439 base::FilePath path = temp_dir_.GetPath().AppendASCII("Favorites"); 441 base::FilePath path = temp_dir_.GetPath().AppendASCII("Favorites");
440 CreateDirectory(path.value().c_str(), NULL); 442 CreateDirectory(path.value().c_str(), NULL);
441 CreateDirectory(path.AppendASCII("SubFolder").value().c_str(), NULL); 443 CreateDirectory(path.AppendASCII("SubFolder").value().c_str(), NULL);
442 base::FilePath links_path = path.AppendASCII("Links"); 444 base::FilePath links_path = path.AppendASCII("Links");
443 CreateDirectory(links_path.value().c_str(), NULL); 445 CreateDirectory(links_path.value().c_str(), NULL);
444 CreateDirectory(links_path.AppendASCII("SubFolderOfLinks").value().c_str(), 446 CreateDirectory(links_path.AppendASCII("SubFolderOfLinks").value().c_str(),
445 NULL); 447 NULL);
446 CreateDirectory(path.AppendASCII("\x0061").value().c_str(), NULL); 448 CreateDirectory(path.AppendASCII("\x0061").value().c_str(), NULL);
447 ASSERT_TRUE(CreateUrlFileWithFavicon(path.AppendASCII("Google Home Page.url"), 449 ASSERT_TRUE(CreateUrlFileWithFavicon(path.AppendASCII("Google Home Page.url"),
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 source_profile.source_path = temp_dir_.GetPath(); 643 source_profile.source_path = temp_dir_.GetPath();
642 644
643 host->StartImportSettings( 645 host->StartImportSettings(
644 source_profile, 646 source_profile,
645 browser()->profile(), 647 browser()->profile(),
646 importer::HOME_PAGE, 648 importer::HOME_PAGE,
647 observer); 649 observer);
648 base::RunLoop().Run(); 650 base::RunLoop().Run();
649 } 651 }
650 652
OLDNEW
« no previous file with comments | « chrome/browser/importer/edge_importer_browsertest_win.cc ('k') | chrome/browser/lifetime/browser_close_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698