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

Unified Diff: net/base/file_stream_unittest.cc

Issue 2334163005: Replace single-threaded SequencedWorkerPool with base::Thread in net_unittests (Closed)
Patch Set: rebase onto r418728 Created 4 years, 3 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/url_request/url_request_simple_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_unittest.cc
diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc
index 76099294fca46c030b64698b5aef6107bac0df02..8b2e43c665570ca61ff2a0503cd96ae7a5850d87 100644
--- a/net/base/file_stream_unittest.cc
+++ b/net/base/file_stream_unittest.cc
@@ -16,8 +16,8 @@
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/synchronization/waitable_event.h"
-#include "base/test/sequenced_worker_pool_owner.h"
#include "base/test/test_timeouts.h"
+#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/base/io_buffer.h"
@@ -727,10 +727,12 @@ TEST_F(FileStreamTest, WriteClose) {
}
TEST_F(FileStreamTest, OpenAndDelete) {
- base::SequencedWorkerPoolOwner pool_owner(1, "StreamTest");
+ base::Thread worker_thread("StreamTest");
+ ASSERT_TRUE(worker_thread.Start());
bool prev = base::ThreadRestrictions::SetIOAllowed(false);
- std::unique_ptr<FileStream> stream(new FileStream(pool_owner.pool()));
+ std::unique_ptr<FileStream> stream(
+ new FileStream(worker_thread.task_runner()));
int flags = base::File::FLAG_OPEN | base::File::FLAG_WRITE |
base::File::FLAG_ASYNC;
TestCompletionCallback open_callback;
@@ -741,8 +743,9 @@ TEST_F(FileStreamTest, OpenAndDelete) {
// complete. Should be safe.
stream.reset();
- // Force an operation through the pool.
- std::unique_ptr<FileStream> stream2(new FileStream(pool_owner.pool()));
+ // Force an operation through the worker.
+ std::unique_ptr<FileStream> stream2(
+ new FileStream(worker_thread.task_runner()));
TestCompletionCallback open_callback2;
rv = stream2->Open(temp_file_path(), flags, open_callback2.callback());
EXPECT_THAT(open_callback2.GetResult(rv), IsOk());
« no previous file with comments | « no previous file | net/url_request/url_request_simple_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698