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

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

Issue 2403533003: Mojo C++ Bindings: Support custom impl ref types (Closed)
Patch Set: nit, move Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 if (g_dump_message_as_hex) { 304 if (g_dump_message_as_hex) {
305 DumpHex(reinterpret_cast<const uint8_t*>(message->data()), 305 DumpHex(reinterpret_cast<const uint8_t*>(message->data()),
306 message->data_num_bytes()); 306 message->data_num_bytes());
307 } 307 }
308 308
309 // In the receiving process, an implementation of ServiceStub is known to 309 // In the receiving process, an implementation of ServiceStub is known to
310 // the system. It receives the incoming message. 310 // the system. It receives the incoming message.
311 ServiceImpl impl; 311 ServiceImpl impl;
312 312
313 ServiceStub stub; 313 ServiceStub<> stub;
314 stub.set_sink(&impl); 314 stub.set_sink(&impl);
315 return stub.Accept(message); 315 return stub.Accept(message);
316 } 316 }
317 317
318 bool AcceptWithResponder(mojo::Message* message, 318 bool AcceptWithResponder(mojo::Message* message,
319 mojo::MessageReceiver* responder) override { 319 mojo::MessageReceiver* responder) override {
320 return false; 320 return false;
321 } 321 }
322 }; 322 };
323 323
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 ASSERT_FALSE(defaults->a22.is_null()); 372 ASSERT_FALSE(defaults->a22.is_null());
373 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape); 373 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape);
374 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color); 374 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color);
375 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23); 375 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23);
376 EXPECT_EQ(0x123456789, defaults->a24); 376 EXPECT_EQ(0x123456789, defaults->a24);
377 EXPECT_EQ(-0x123456789, defaults->a25); 377 EXPECT_EQ(-0x123456789, defaults->a25);
378 } 378 }
379 379
380 } // namespace 380 } // namespace
381 } // namespace sample 381 } // namespace sample
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698