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

Unified Diff: base/async_socket_io_handler_unittest.cc

Issue 1100773004: base: Remove most uses of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing includes. Created 5 years, 8 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 | « base/android/application_status_listener_unittest.cc ('k') | base/bind_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/async_socket_io_handler_unittest.cc
diff --git a/base/async_socket_io_handler_unittest.cc b/base/async_socket_io_handler_unittest.cc
index 2b0e3c25c30af9d09949c3bda4248846a61caf4f..721de9cd72d43c32583e9646cb029bb20c1a29b6 100644
--- a/base/async_socket_io_handler_unittest.cc
+++ b/base/async_socket_io_handler_unittest.cc
@@ -5,6 +5,9 @@
#include "base/async_socket_io_handler.h"
#include "base/bind.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -104,8 +107,8 @@ TEST(AsyncSocketIoHandlerTest, SynchronousReadWithMessageLoop) {
TestSocketReader reader(&pair[0], -1, false, false);
pair[1].Send(kAsyncSocketIoTestString, kAsyncSocketIoTestStringLength);
- base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::MessageLoop::QuitClosure(),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::MessageLoop::QuitClosure(),
base::TimeDelta::FromMilliseconds(100));
base::MessageLoop::current()->Run();
@@ -135,15 +138,15 @@ TEST(AsyncSocketIoHandlerTest, ReadFromCallback) {
// Issue sends on an interval to satisfy the Read() requirements.
int64 milliseconds = 0;
for (int i = 0; i < kReadOperationCount; ++i) {
- base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::Bind(&SendData, &pair[1], kAsyncSocketIoTestString,
- kAsyncSocketIoTestStringLength),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&SendData, &pair[1], kAsyncSocketIoTestString,
+ kAsyncSocketIoTestStringLength),
base::TimeDelta::FromMilliseconds(milliseconds));
milliseconds += 10;
}
- base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::MessageLoop::QuitClosure(),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::MessageLoop::QuitClosure(),
base::TimeDelta::FromMilliseconds(100 + milliseconds));
base::MessageLoop::current()->Run();
« no previous file with comments | « base/android/application_status_listener_unittest.cc ('k') | base/bind_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698