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

Side by Side Diff: mojo/public/tests/bindings_connector_unittest.cc

Issue 68203005: Mojo: Make tests under mojo/public use our own run_all_unittests.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « mojo/public/bindings/sample/sample_test.cc ('k') | mojo/public/tests/system_core_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/basictypes.h"
darin (slow to review) 2013/11/11 21:31:42 I meant to make this be clean of base/ dependencie
viettrungluu 2013/11/11 21:56:06 I can take care of this.
9 #include "base/compiler_specific.h"
8 #include "mojo/public/bindings/lib/bindings_support.h" 10 #include "mojo/public/bindings/lib/bindings_support.h"
9 #include "mojo/public/bindings/lib/connector.h" 11 #include "mojo/public/bindings/lib/connector.h"
10 #include "mojo/public/bindings/lib/message_queue.h" 12 #include "mojo/public/bindings/lib/message_queue.h"
11 #include "mojo/public/tests/simple_bindings_support.h" 13 #include "mojo/public/tests/simple_bindings_support.h"
12 #include "mojo/public/tests/test_support.h" 14 #include "testing/gtest/include/gtest/gtest.h"
13 15
14 namespace mojo { 16 namespace mojo {
15 namespace test { 17 namespace test {
16 18
17 class MessageAccumulator : public MessageReceiver { 19 class MessageAccumulator : public MessageReceiver {
18 public: 20 public:
19 MessageAccumulator() { 21 MessageAccumulator() {
20 } 22 }
21 23
22 virtual bool Accept(Message* message) MOJO_OVERRIDE { 24 virtual bool Accept(Message* message) MOJO_OVERRIDE {
23 queue_.Push(message); 25 queue_.Push(message);
24 return true; 26 return true;
25 } 27 }
26 28
27 bool IsEmpty() const { 29 bool IsEmpty() const {
28 return queue_.IsEmpty(); 30 return queue_.IsEmpty();
29 } 31 }
30 32
31 void Pop(Message* message) { 33 void Pop(Message* message) {
32 queue_.Pop(message); 34 queue_.Pop(message);
33 } 35 }
34 36
35 private: 37 private:
36 MessageQueue queue_; 38 MessageQueue queue_;
37 }; 39 };
38 40
39 class BindingsConnectorTest : public TestBase { 41 class BindingsConnectorTest : public testing::Test {
40 public: 42 public:
41 BindingsConnectorTest() 43 BindingsConnectorTest()
42 : handle0_(kInvalidHandle), 44 : handle0_(kInvalidHandle),
43 handle1_(kInvalidHandle) { 45 handle1_(kInvalidHandle) {
44 } 46 }
45 47
46 virtual void SetUp() OVERRIDE { 48 virtual void SetUp() OVERRIDE {
47 CreateMessagePipe(&handle0_, &handle1_); 49 CreateMessagePipe(&handle0_, &handle1_);
48 } 50 }
49 51
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 std::string( 209 std::string(
208 reinterpret_cast<char*>(message_received.data->payload))); 210 reinterpret_cast<char*>(message_received.data->payload)));
209 ASSERT_EQ(2U, message_received.handles.size()); 211 ASSERT_EQ(2U, message_received.handles.size());
210 EXPECT_EQ(handles[0].value, message_received.handles[0].value); 212 EXPECT_EQ(handles[0].value, message_received.handles[0].value);
211 EXPECT_EQ(handles[1].value, message_received.handles[1].value); 213 EXPECT_EQ(handles[1].value, message_received.handles[1].value);
212 } 214 }
213 #endif 215 #endif
214 216
215 } // namespace test 217 } // namespace test
216 } // namespace mojo 218 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/bindings/sample/sample_test.cc ('k') | mojo/public/tests/system_core_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698