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

Unified Diff: chrome/browser/extensions/extension_webui_apitest.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_webui_apitest.cc
diff --git a/chrome/browser/extensions/extension_webui_apitest.cc b/chrome/browser/extensions/extension_webui_apitest.cc
index de1a34c7a39e146bcd15cb158066cfb7f547ad08..1fd6e8c411d61d21f0964a97510c60c94a61fac3 100644
--- a/chrome/browser/extensions/extension_webui_apitest.cc
+++ b/chrome/browser/extensions/extension_webui_apitest.cc
@@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
+#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/extension_apitest.h"
@@ -35,18 +36,21 @@ class ExtensionWebUITest : public ExtensionApiTest {
const GURL& page_url,
const GURL& frame_url,
bool expected_result) {
- // Tests are located in chrome/test/data/extensions/webui/$(name).
- base::FilePath path;
- PathService::Get(chrome::DIR_TEST_DATA, &path);
- path =
- path.AppendASCII("extensions").AppendASCII("webui").AppendASCII(name);
-
- // Read the test.
- if (!base::PathExists(path))
- return testing::AssertionFailure() << "Couldn't find " << path.value();
std::string script;
- base::ReadFileToString(path, &script);
- script = "(function(){'use strict';" + script + "}());";
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ // Tests are located in chrome/test/data/extensions/webui/$(name).
+ base::FilePath path;
+ PathService::Get(chrome::DIR_TEST_DATA, &path);
+ path =
+ path.AppendASCII("extensions").AppendASCII("webui").AppendASCII(name);
+
+ // Read the test.
+ if (!base::PathExists(path))
+ return testing::AssertionFailure() << "Couldn't find " << path.value();
+ base::ReadFileToString(path, &script);
+ script = "(function(){'use strict';" + script + "}());";
+ }
// Run the test.
bool actual_result = false;

Powered by Google App Engine
This is Rietveld 408576698