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

Side by Side Diff: mojo/public/cpp/bindings/tests/connector_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 <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "mojo/public/cpp/bindings/lib/connector.h" 8 #include "mojo/public/cpp/bindings/lib/connector.h"
9 #include "mojo/public/cpp/bindings/lib/message_builder.h" 9 #include "mojo/public/cpp/bindings/lib/message_builder.h"
10 #include "mojo/public/cpp/bindings/lib/message_queue.h" 10 #include "mojo/public/cpp/bindings/lib/message_queue.h"
(...skipping 27 matching lines...) Expand all
38 private: 38 private:
39 internal::MessageQueue queue_; 39 internal::MessageQueue queue_;
40 }; 40 };
41 41
42 class ConnectorTest : public testing::Test { 42 class ConnectorTest : public testing::Test {
43 public: 43 public:
44 ConnectorTest() { 44 ConnectorTest() {
45 } 45 }
46 46
47 virtual void SetUp() MOJO_OVERRIDE { 47 virtual void SetUp() MOJO_OVERRIDE {
48 CreateMessagePipe(&handle0_, &handle1_); 48 CreateMessagePipe(NULL, &handle0_, &handle1_);
49 } 49 }
50 50
51 virtual void TearDown() MOJO_OVERRIDE { 51 virtual void TearDown() MOJO_OVERRIDE {
52 } 52 }
53 53
54 void AllocMessage(const char* text, Message* message) { 54 void AllocMessage(const char* text, Message* message) {
55 size_t payload_size = strlen(text) + 1; // Plus null terminator. 55 size_t payload_size = strlen(text) + 1; // Plus null terminator.
56 internal::MessageBuilder builder(1, payload_size); 56 internal::MessageBuilder builder(1, payload_size);
57 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size); 57 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size);
58 builder.Finish(message); 58 builder.Finish(message);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 accumulator.Pop(&message_received); 235 accumulator.Pop(&message_received);
236 236
237 EXPECT_EQ( 237 EXPECT_EQ(
238 std::string(kText), 238 std::string(kText),
239 std::string(reinterpret_cast<const char*>(message_received.payload()))); 239 std::string(reinterpret_cast<const char*>(message_received.payload())));
240 } 240 }
241 241
242 } // namespace 242 } // namespace
243 } // namespace test 243 } // namespace test
244 } // namespace mojo 244 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/common/message_pump_mojo.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