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

Unified Diff: chrome/test/base/testing_profile.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
« no previous file with comments | « chrome/test/base/javascript_browser_test.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index edeed7859bf421be26f6801bc2933046e7ffaf19..c43d29fdee2dbfb04d59119c832b39124fcdedb7 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -16,6 +16,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
+#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
@@ -391,6 +392,7 @@ TestingProfile::TestingProfile(
}
void TestingProfile::CreateTempProfileDir() {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
if (!temp_dir_.CreateUniqueTempDir()) {
LOG(ERROR) << "Failed to create unique temporary directory.";
@@ -418,6 +420,7 @@ void TestingProfile::CreateTempProfileDir() {
}
void TestingProfile::Init() {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
// If threads have been initialized, we should be on the UI thread.
DCHECK(!content::BrowserThread::IsThreadInitialized(
content::BrowserThread::UI) ||
@@ -561,6 +564,9 @@ TestingProfile::~TestingProfile() {
resource_context_ = NULL;
content::RunAllPendingInMessageLoop(BrowserThread::IO);
}
+
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ ignore_result(temp_dir_.Delete());
}
void TestingProfile::CreateFaviconService() {
« no previous file with comments | « chrome/test/base/javascript_browser_test.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698