OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "mojo/public/environment/environment.h" | 9 #include "mojo/public/environment/environment.h" |
10 #include "mojom/sample_service.h" | 10 #include "mojom/sample_service.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 Foo foo = MakeFoo(); | 303 Foo foo = MakeFoo(); |
304 CheckFoo(foo); | 304 CheckFoo(foo); |
305 | 305 |
306 mojo::ScopedMessagePipeHandle port0, port1; | 306 mojo::ScopedMessagePipeHandle port0, port1; |
307 mojo::CreateMessagePipe(&port0, &port1); | 307 mojo::CreateMessagePipe(&port0, &port1); |
308 | 308 |
309 service->Frobinate(foo, Service::BAZ_EXTRA, port0.Pass()); | 309 service->Frobinate(foo, Service::BAZ_EXTRA, port0.Pass()); |
310 } | 310 } |
311 | 311 |
| 312 TEST(BindingsSampleTest, DefaultValues) { |
| 313 mojo::Environment env; |
| 314 SimpleMessageReceiver receiver; |
| 315 mojo::AllocationScope scope; |
| 316 |
| 317 Bar bar = Bar::Builder().Finish(); |
| 318 EXPECT_EQ(255, bar.alpha()); |
| 319 |
| 320 Foo foo = Foo::Builder().Finish(); |
| 321 ASSERT_FALSE(foo.name().is_null()); |
| 322 EXPECT_EQ("Fooby", foo.name().To<std::string>()); |
| 323 EXPECT_TRUE(foo.a()); |
| 324 } |
| 325 |
312 } // namespace sample | 326 } // namespace sample |
OLD | NEW |