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

Unified Diff: chrome/test/base/ui_test_utils.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/testing_profile.cc ('k') | chrome/test/base/web_ui_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/ui_test_utils.cc
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index d74c337f4d9ce254b1c761c016344f75a02ccdb5..dbfc6b7f1a185891cca97812b1d22427b21df6c0 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -19,6 +19,7 @@
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_timeouts.h"
+#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
@@ -281,6 +282,7 @@ void NavigateToURLBlockUntilNavigationsComplete(Browser* browser,
base::FilePath GetTestFilePath(const base::FilePath& dir,
const base::FilePath& file) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
base::FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
return path.Append(dir).Append(file);
@@ -291,6 +293,7 @@ GURL GetTestUrl(const base::FilePath& dir, const base::FilePath& file) {
}
bool GetRelativeBuildDirectory(base::FilePath* build_dir) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
// This function is used to find the build directory so TestServer can serve
// built files (nexes, etc). TestServer expects a path relative to the source
// root.
@@ -363,6 +366,7 @@ int FindInPage(WebContents* tab,
}
void DownloadURL(Browser* browser, const GURL& download_url) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
base::ScopedTempDir downloads_directory;
ASSERT_TRUE(downloads_directory.CreateUniqueTempDir());
browser->profile()->GetPrefs()->SetFilePath(prefs::kDownloadDefaultDirectory,
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | chrome/test/base/web_ui_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698