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. |