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

Side by Side Diff: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc

Issue 328753003: Mojo: Plumb MojoCreateMessagePipeOptions through to the C++ wrappers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/environment/environment.h" 5 #include "mojo/public/cpp/environment/environment.h"
6 #include "mojo/public/cpp/test_support/test_utils.h" 6 #include "mojo/public/cpp/test_support/test_utils.h"
7 #include "mojo/public/cpp/utility/run_loop.h" 7 #include "mojo/public/cpp/utility/run_loop.h"
8 #include "mojo/public/interfaces/bindings/tests/sample_factory.mojom.h" 8 #include "mojo/public/interfaces/bindings/tests/sample_factory.mojom.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 std::string text2; 60 std::string text2;
61 if (request->pipe.is_valid()) { 61 if (request->pipe.is_valid()) {
62 EXPECT_TRUE(ReadTextMessage(request->pipe.get(), &text2)); 62 EXPECT_TRUE(ReadTextMessage(request->pipe.get(), &text2));
63 63
64 // Ensure that simply accessing request->pipe does not close it. 64 // Ensure that simply accessing request->pipe does not close it.
65 EXPECT_TRUE(request->pipe.is_valid()); 65 EXPECT_TRUE(request->pipe.is_valid());
66 } 66 }
67 67
68 ScopedMessagePipeHandle pipe0; 68 ScopedMessagePipeHandle pipe0;
69 if (!text2.empty()) { 69 if (!text2.empty()) {
70 CreateMessagePipe(&pipe0, &pipe1_); 70 CreateMessagePipe(NULL, &pipe0, &pipe1_);
71 EXPECT_TRUE(WriteTextMessage(pipe1_.get(), text2)); 71 EXPECT_TRUE(WriteTextMessage(pipe1_.get(), text2));
72 } 72 }
73 73
74 sample::ResponsePtr response(sample::Response::New()); 74 sample::ResponsePtr response(sample::Response::New());
75 response->x = 2; 75 response->x = 2;
76 response->pipe = pipe0.Pass(); 76 response->pipe = pipe0.Pass();
77 client()->DidStuff(response.Pass(), text1); 77 client()->DidStuff(response.Pass(), text1);
78 } 78 }
79 79
80 virtual void DoStuff2(ScopedDataPipeConsumerHandle pipe) MOJO_OVERRIDE { 80 virtual void DoStuff2(ScopedDataPipeConsumerHandle pipe) MOJO_OVERRIDE {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 PumpMessages(); // Yield for results. 319 PumpMessages(); // Yield for results.
320 320
321 EXPECT_EQ(std::string("object1"), name1); 321 EXPECT_EQ(std::string("object1"), name1);
322 EXPECT_EQ(std::string("object2"), name2); 322 EXPECT_EQ(std::string("object2"), name2);
323 } 323 }
324 324
325 } // namespace 325 } // namespace
326 } // namespace test 326 } // namespace test
327 } // namespace mojo 327 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/connector_unittest.cc ('k') | mojo/public/cpp/bindings/tests/router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698