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

Unified Diff: chrome/browser/extensions/extension_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/extensions/extension_browsertest.cc
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index 1aa8bd631886c3ec4ba8b382353c62064ba22c4a..b425a4437800b8419780f6e871c8cc0f90aaf0e8 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -18,6 +18,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_scheduler/post_task.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/browsertest_util.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
@@ -149,6 +150,7 @@ Profile* ExtensionBrowserTest::profile() {
const Extension* ExtensionBrowserTest::GetExtensionByPath(
const extensions::ExtensionSet& extensions,
const base::FilePath& path) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
base::FilePath extension_path = base::MakeAbsoluteFilePath(path);
EXPECT_TRUE(!extension_path.empty());
for (const scoped_refptr<const Extension>& extension : extensions) {
@@ -252,6 +254,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionAsComponentWithManifest(
profile())->extension_service();
ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
std::string manifest;
if (!base::ReadFileToString(path.Append(manifest_relative_path), &manifest)) {
return NULL;
@@ -292,6 +295,7 @@ const Extension* ExtensionBrowserTest::LoadAndLaunchApp(
base::FilePath ExtensionBrowserTest::PackExtension(
const base::FilePath& dir_path) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
base::FilePath crx_path = temp_dir_.GetPath().AppendASCII("temp.crx");
if (!base::DeleteFile(crx_path, false)) {
ADD_FAILURE() << "Failed to delete crx: " << crx_path.value();
@@ -320,6 +324,7 @@ base::FilePath ExtensionBrowserTest::PackExtensionWithOptions(
const base::FilePath& crx_path,
const base::FilePath& pem_path,
const base::FilePath& pem_out_path) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
if (!base::PathExists(dir_path)) {
ADD_FAILURE() << "Extension dir not found: " << dir_path.value();
return base::FilePath();
« no previous file with comments | « chrome/browser/extensions/crx_installer_browsertest.cc ('k') | chrome/browser/extensions/extension_keybinding_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698