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

Unified Diff: content/test/webui_resource_browsertest.cc

Issue 2175933002: More aggressive IO asserts in content_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 1 less instance of ScopedAllowIO in DumpAccessibilityTestBase::RunTestForPlatform. Created 4 years, 5 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 | « content/test/ppapi/ppapi_test.cc ('k') | net/cert/test_root_certs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/webui_resource_browsertest.cc
diff --git a/content/test/webui_resource_browsertest.cc b/content/test/webui_resource_browsertest.cc
index 2c239af060b08100fd1ff5ce46e6eeebbaf3c2c2..3731475af14e2f3996739c1b06ca1bed5e24a5a2 100644
--- a/content/test/webui_resource_browsertest.cc
+++ b/content/test/webui_resource_browsertest.cc
@@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/path_service.h"
+#include "base/threading/thread_restrictions.h"
#include "content/grit/content_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_paths.h"
@@ -25,7 +26,11 @@ class WebUIResourceBrowserTest : public ContentBrowserTest {
// Runs all test functions in |file|, waiting for them to complete.
void RunTest(const base::FilePath& file) {
- ASSERT_TRUE(PathExists(file));
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_file_existance_check;
+ ASSERT_TRUE(PathExists(file));
+ }
+
NavigateToURL(shell(), net::FilePathToFileURL(file));
content::WebContents* web_contents = shell()->web_contents();
@@ -36,12 +41,7 @@ class WebUIResourceBrowserTest : public ContentBrowserTest {
void RunMediaInternalsTest(const base::FilePath::CharType* file) {
AddLibrary(IDR_WEBUI_JS_CR);
AddLibrary(IDR_MEDIA_INTERNALS_JS);
-
- base::FilePath path;
- PathService::Get(DIR_TEST_DATA, &path);
- RunTest(path.Append(FILE_PATH_LITERAL("media"))
- .Append(FILE_PATH_LITERAL("webui"))
- .Append(file));
+ RunTest(GetTestFilePath("media", "webui").Append(file));
}
// Queues the library corresponding to |resource_id| for injection into the
« no previous file with comments | « content/test/ppapi/ppapi_test.cc ('k') | net/cert/test_root_certs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698