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

Unified Diff: mojo/public/cpp/bindings/tests/connector_unittest.cc

Issue 328713004: Mojo: Use the MessagePipe creation helper whenever possible/reasonable in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: mojo/public/cpp/bindings/tests/connector_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/connector_unittest.cc b/mojo/public/cpp/bindings/tests/connector_unittest.cc
index 4767b98f87c38fc2edae47ea9e2f666e401eb04d..f5a4eb79fc5a9b7002c0a68c5708a240fd6c8082 100644
--- a/mojo/public/cpp/bindings/tests/connector_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/connector_unittest.cc
@@ -180,7 +180,6 @@ TEST_F(ConnectorTest, WriteToClosedPipe) {
EXPECT_TRUE(connector0.encountered_error());
}
-// Enable this test once MojoWriteMessage supports passing handles.
TEST_F(ConnectorTest, MessageWithHandles) {
internal::Connector connector0(handle0_.Pass());
internal::Connector connector1(handle1_.Pass());
@@ -190,9 +189,8 @@ TEST_F(ConnectorTest, MessageWithHandles) {
Message message1;
AllocMessage(kText, &message1);
- ScopedMessagePipeHandle handles[2];
- CreateMessagePipe(&handles[0], &handles[1]);
- message1.mutable_handles()->push_back(handles[0].release());
+ MessagePipe pipe;
+ message1.mutable_handles()->push_back(pipe.handle0.release());
connector0.Accept(&message1);
@@ -223,7 +221,7 @@ TEST_F(ConnectorTest, MessageWithHandles) {
// |smph| now owns this handle.
internal::Connector connector_received(smph.Pass());
- internal::Connector connector_original(handles[1].Pass());
+ internal::Connector connector_original(pipe.handle1.Pass());
Message message2;
AllocMessage(kText, &message2);
« no previous file with comments | « mojo/public/cpp/bindings/tests/array_unittest.cc ('k') | mojo/public/cpp/bindings/tests/handle_passing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698