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

Unified Diff: net/disk_cache/disk_cache_test_base.h

Issue 2608093002: Use TaskScheduler instead of WorkerPool in file_ios.cc. (Closed)
Patch Set: self-review Created 3 years, 11 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 | « net/disk_cache/blockfile/file_ios.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/disk_cache_test_base.h
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h
index c94f5ac82ed0b3f9980d54d6899ce28bfea75a54..9dde5bf3948d098fc64e53f762165259e47aa046 100644
--- a/net/disk_cache/disk_cache_test_base.h
+++ b/net/disk_cache/disk_cache_test_base.h
@@ -12,6 +12,7 @@
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
+#include "base/test/scoped_async_task_scheduler.h"
#include "base/threading/thread.h"
#include "net/base/cache_type.h"
#include "net/disk_cache/disk_cache.h"
@@ -56,6 +57,12 @@ class DiskCacheTest : public PlatformTest {
private:
base::ScopedTempDir temp_dir_;
std::unique_ptr<base::MessageLoop> message_loop_;
+
+ // Use a ScopedAsyncTaskScheduler instead of a ScopedTaskScheduler to allow
+ // disk_cache::InFlightIO::WaitForPendingIO to wait for TaskScheduler tasks
+ // from the main thread using WaitableEvents (this wouldn't work if
+ // TaskScheduler tasks ran on the main thread).
+ base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_;
};
// Provides basic support for cache related tests.
« no previous file with comments | « net/disk_cache/blockfile/file_ios.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698