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

Unified Diff: mojo/system/channel_unittest.cc

Issue 588193004: Mojo: Have |ProxyMessagePipeEndpoint|s constructed with a |ChannelEndpoint|. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « mojo/embedder/embedder.cc ('k') | mojo/system/message_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel_unittest.cc
diff --git a/mojo/system/channel_unittest.cc b/mojo/system/channel_unittest.cc
index 18329a853f107bdf355250086f4bdbd4627fdc24..e7100968ca432820fe57481f5603124dc5ada0b0 100644
--- a/mojo/system/channel_unittest.cc
+++ b/mojo/system/channel_unittest.cc
@@ -194,10 +194,12 @@ TEST_F(ChannelTest, CloseBeforeRun) {
base::Bind(&ChannelTest::InitChannelOnIOThread, base::Unretained(this)));
EXPECT_EQ(TRISTATE_TRUE, init_result());
- scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy());
+ scoped_refptr<ChannelEndpoint> channel_endpoint;
+ scoped_refptr<MessagePipe> mp(
+ MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id = channel()->AttachEndpoint(
- make_scoped_refptr(new ChannelEndpoint(mp.get(), 1)));
+ MessageInTransit::EndpointId local_id =
+ channel()->AttachEndpoint(channel_endpoint);
EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
mp->Close(0);
@@ -232,10 +234,12 @@ TEST_F(ChannelTest, ShutdownAfterAttach) {
base::Bind(&ChannelTest::InitChannelOnIOThread, base::Unretained(this)));
EXPECT_EQ(TRISTATE_TRUE, init_result());
- scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy());
+ scoped_refptr<ChannelEndpoint> channel_endpoint;
+ scoped_refptr<MessagePipe> mp(
+ MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id = channel()->AttachEndpoint(
- make_scoped_refptr(new ChannelEndpoint(mp.get(), 1)));
+ MessageInTransit::EndpointId local_id =
+ channel()->AttachEndpoint(channel_endpoint);
EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
// TODO(vtl): Currently, we always "expect" a |RunMessagePipeEndpoint()| after
@@ -282,10 +286,12 @@ TEST_F(ChannelTest, WaitAfterAttachRunAndShutdown) {
base::Bind(&ChannelTest::InitChannelOnIOThread, base::Unretained(this)));
EXPECT_EQ(TRISTATE_TRUE, init_result());
- scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy());
+ scoped_refptr<ChannelEndpoint> channel_endpoint;
+ scoped_refptr<MessagePipe> mp(
+ MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id = channel()->AttachEndpoint(
- make_scoped_refptr(new ChannelEndpoint(mp.get(), 1)));
+ MessageInTransit::EndpointId local_id =
+ channel()->AttachEndpoint(channel_endpoint);
EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
EXPECT_TRUE(channel()->RunMessagePipeEndpoint(local_id,
« no previous file with comments | « mojo/embedder/embedder.cc ('k') | mojo/system/message_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698