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

Unified Diff: content/browser/tracing/tracing_controller_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
Index: content/browser/tracing/tracing_controller_browsertest.cc
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc
index 3dbc7d364b06fa2044ebbd58759b6a6ece92e746..c3a2adc553bf700da0363a02b4bf9381b7ac842f 100644
--- a/content/browser/tracing/tracing_controller_browsertest.cc
+++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/run_loop.h"
#include "base/strings/pattern.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "content/browser/tracing/tracing_controller_impl.h"
#include "content/public/browser/browser_thread.h"
@@ -152,10 +153,13 @@ class TracingControllerTest : public ContentBrowserTest {
void StopTracingFileDoneCallbackTest(base::Closure quit_callback,
const base::FilePath& file_path) {
disable_recording_done_callback_count_++;
- EXPECT_TRUE(PathExists(file_path));
- int64_t file_size;
- base::GetFileSize(file_path, &file_size);
- EXPECT_TRUE(file_size > 0);
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_verifications;
+ EXPECT_TRUE(PathExists(file_path));
+ int64_t file_size;
+ base::GetFileSize(file_path, &file_size);
+ EXPECT_GT(file_size, 0);
+ }
quit_callback.Run();
last_actual_recording_file_path_ = file_path;
}
@@ -419,7 +423,10 @@ IN_PROC_BROWSER_TEST_F(TracingControllerTest, NotWhitelistedMetadataStripped) {
IN_PROC_BROWSER_TEST_F(TracingControllerTest,
EnableAndStopTracingWithFilePath) {
base::FilePath file_path;
- base::CreateTemporaryFile(&file_path);
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_creating_test_file;
+ base::CreateTemporaryFile(&file_path);
+ }
TestStartAndStopTracingFile(file_path);
EXPECT_EQ(file_path.value(), last_actual_recording_file_path().value());
}
« no previous file with comments | « content/browser/renderer_host/render_view_host_browsertest.cc ('k') | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698