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

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

Issue 644963004: Some more virtual/override updates. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 private: 69 private:
70 internal::Connector* connector_; 70 internal::Connector* connector_;
71 int number_of_calls_; 71 int number_of_calls_;
72 }; 72 };
73 73
74 class ConnectorTest : public testing::Test { 74 class ConnectorTest : public testing::Test {
75 public: 75 public:
76 ConnectorTest() {} 76 ConnectorTest() {}
77 77
78 virtual void SetUp() override { 78 void SetUp() override {
79 CreateMessagePipe(nullptr, &handle0_, &handle1_); 79 CreateMessagePipe(nullptr, &handle0_, &handle1_);
80 } 80 }
81 81
82 virtual void TearDown() override {} 82 void TearDown() override {}
83 83
84 void AllocMessage(const char* text, Message* message) { 84 void AllocMessage(const char* text, Message* message) {
85 size_t payload_size = strlen(text) + 1; // Plus null terminator. 85 size_t payload_size = strlen(text) + 1; // Plus null terminator.
86 internal::MessageBuilder builder(1, payload_size); 86 internal::MessageBuilder builder(1, payload_size);
87 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size); 87 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size);
88 builder.Finish(message); 88 builder.Finish(message);
89 } 89 }
90 90
91 void PumpMessages() { loop_.RunUntilIdle(); } 91 void PumpMessages() { loop_.RunUntilIdle(); }
92 92
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 std::string(kText[i]), 385 std::string(kText[i]),
386 std::string(reinterpret_cast<const char*>(message_received.payload()))); 386 std::string(reinterpret_cast<const char*>(message_received.payload())));
387 } 387 }
388 388
389 ASSERT_EQ(2, accumulator.number_of_calls()); 389 ASSERT_EQ(2, accumulator.number_of_calls());
390 } 390 }
391 391
392 } // namespace 392 } // namespace
393 } // namespace test 393 } // namespace test
394 } // namespace mojo 394 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/array_unittest.cc ('k') | mojo/public/cpp/bindings/tests/equals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698