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

Unified Diff: mojo/edk/system/channel_manager_unittest.cc

Issue 1507903006: EDK: Remove mojo::platform::MessageLoopForIO and add PlatformHandleWatcher. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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
Index: mojo/edk/system/channel_manager_unittest.cc
diff --git a/mojo/edk/system/channel_manager_unittest.cc b/mojo/edk/system/channel_manager_unittest.cc
index 581ea839bf1a8cfea81f60466606c8baf6a85574..a64f86aa9d4c98e7c0b639604937fe12b436bb98 100644
--- a/mojo/edk/system/channel_manager_unittest.cc
+++ b/mojo/edk/system/channel_manager_unittest.cc
@@ -11,7 +11,6 @@
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/edk/platform/message_loop.h"
-#include "mojo/edk/platform/message_loop_for_io.h"
#include "mojo/edk/platform/task_runner.h"
#include "mojo/edk/platform/test_message_loops.h"
#include "mojo/edk/system/channel.h"
@@ -23,7 +22,7 @@
#include "testing/gtest/include/gtest/gtest.h"
using mojo::platform::MessageLoop;
-using mojo::platform::MessageLoopForIO;
+using mojo::platform::PlatformHandleWatcher;
using mojo::platform::TaskRunner;
using mojo::platform::test::CreateTestMessageLoop;
using mojo::platform::test::CreateTestMessageLoopForIO;
@@ -36,7 +35,8 @@ namespace {
class ChannelManagerTest : public testing::Test {
public:
ChannelManagerTest()
- : message_loop_(CreateTestMessageLoopForIO()),
+ : platform_handle_watcher_(nullptr),
+ message_loop_(CreateTestMessageLoopForIO(&platform_handle_watcher_)),
channel_manager_(&platform_support_,
message_loop_->GetTaskRunner().Clone(),
nullptr) {}
@@ -51,7 +51,11 @@ class ChannelManagerTest : public testing::Test {
private:
embedder::SimplePlatformSupport platform_support_;
- std::unique_ptr<MessageLoopForIO> message_loop_;
+ // TODO(vtl): The |PlatformHandleWatcher| and |MessageLoop| should be injected
+ // into the |ChannelManager|.
+ // Valid while |message_loop_| is valid.
+ PlatformHandleWatcher* platform_handle_watcher_;
+ std::unique_ptr<MessageLoop> message_loop_;
// Note: This should be *after* the above, since they must be initialized
// before it (and should outlive it).
ChannelManager channel_manager_;
« mojo/edk/base_edk/test_message_loops_unittest.cc ('K') | « mojo/edk/platform/test_message_loops.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698