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

Unified Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 2910263002: [Media Router tests] Add minimal ScopedAllowIO for the tests to pass. (Closed)
Patch Set: Addressed Mark's comments Created 3 years, 7 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 | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/media_router/media_router_integration_browsertest.cc
diff --git a/chrome/test/media_router/media_router_integration_browsertest.cc b/chrome/test/media_router/media_router_integration_browsertest.cc
index ff88be48d2fdbf023220b2cd6ee90f269ef2360b..8358165aee2a3ef4e3f1c0629b2b76d1aacec424 100644
--- a/chrome/test/media_router/media_router_integration_browsertest.cc
+++ b/chrome/test/media_router/media_router_integration_browsertest.cc
@@ -13,6 +13,7 @@
#include "base/json/json_writer.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
+#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -283,8 +284,12 @@ void MediaRouterIntegrationBrowserTest::SetTestData(
JSONFileValueDeserializer deserializer(full_path);
int error_code = 0;
std::string error_message;
- std::unique_ptr<base::Value> value =
- deserializer.Deserialize(&error_code, &error_message);
+ std::unique_ptr<base::Value> value;
+ {
+ // crbug.com/724573
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ value = deserializer.Deserialize(&error_code, &error_message);
+ }
CHECK(value.get()) << "Deserialize failed: " << error_message;
std::string test_data_str;
ASSERT_TRUE(base::JSONWriter::Write(*value, &test_data_str));
@@ -318,7 +323,11 @@ base::FilePath MediaRouterIntegrationBrowserTest::GetResourceFile(
CHECK(PathService::Get(base::DIR_MODULE, &base_dir));
base::FilePath full_path =
base_dir.Append(kResourcePath).Append(relative_path);
- CHECK(PathExists(full_path));
+ {
+ // crbug.com/724573
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ CHECK(PathExists(full_path));
+ }
return full_path;
}
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698