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

Unified Diff: chrome/browser/lifetime/browser_close_manager_browsertest.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/lifetime/browser_close_manager_browsertest.cc
diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
index f711acc05d5c688f1600af093148435bf5d60b80..c25223da6cd8f24924c8e91189faf18a25463d00 100644
--- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc
+++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process.h"
@@ -1163,12 +1164,16 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithDownloadsBrowserTest,
TestWithDownloadsFromDifferentProfiles) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
- base::FilePath path =
- profile_manager->user_data_dir().AppendASCII("test_profile");
- if (!base::PathExists(path))
- ASSERT_TRUE(base::CreateDirectory(path));
- Profile* other_profile =
- Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS);
+ Profile* other_profile = nullptr;
+ {
+ base::FilePath path =
+ profile_manager->user_data_dir().AppendASCII("test_profile");
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ if (!base::PathExists(path))
+ ASSERT_TRUE(base::CreateDirectory(path));
+ other_profile =
+ Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS);
+ }
profile_manager->RegisterTestingProfile(other_profile, true, false);
Browser* other_profile_browser = CreateBrowser(other_profile);

Powered by Google App Engine
This is Rietveld 408576698