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

Unified Diff: net/disk_cache/backend_unittest.cc

Issue 2610503002: Use TaskScheduler instead of WorkerPool in cache_util.cc. (Closed)
Patch Set: add ScopedTaskScheduler 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 | « no previous file | net/disk_cache/cache_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_unittest.cc
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index e92dd9b2f59ce8d07ee293ce6e536c16402ec1ce..14580c0512ea5d7646882fb08514da6b99e4580c 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/mock_entropy_provider.h"
+#include "base/test/scoped_task_scheduler.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_restrictions.h"
@@ -82,6 +83,9 @@ std::unique_ptr<disk_cache::BackendImpl> CreateExistingEntryCache(
// Tests that can run with different types of caches.
class DiskCacheBackendTest : public DiskCacheTestWithCache {
protected:
+ DiskCacheBackendTest()
+ : scoped_task_scheduler_(base::MessageLoop::current()) {}
+
// Some utility methods:
// Perform IO operations on the cache until there is pending IO.
@@ -149,6 +153,9 @@ class DiskCacheBackendTest : public DiskCacheTestWithCache {
void BackendDisabledAPI();
void BackendEviction();
+
+ private:
+ base::test::ScopedTaskScheduler scoped_task_scheduler_;
};
int DiskCacheBackendTest::GeneratePendingIO(net::TestCompletionCallback* cb) {
@@ -2047,6 +2054,8 @@ TEST_F(DiskCacheTest, WrongVersion) {
// blockfile caches.
#if !defined(OS_ANDROID)
TEST_F(DiskCacheTest, SimpleCacheControlJoin) {
+ base::test::ScopedTaskScheduler scoped_task_scheduler(
+ base::MessageLoop::current());
base::Thread cache_thread("CacheThread");
ASSERT_TRUE(cache_thread.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
« no previous file with comments | « no previous file | net/disk_cache/cache_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698