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/bindings/allocation_scope.h" | 9 #include "mojo/public/bindings/allocation_scope.h" |
10 #include "mojo/public/environment/environment.h" | 10 #include "mojo/public/environment/environment.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 EXPECT_EQ(255, bar.alpha()); | 319 EXPECT_EQ(255, bar.alpha()); |
320 | 320 |
321 Foo foo = Foo::Builder().Finish(); | 321 Foo foo = Foo::Builder().Finish(); |
322 ASSERT_FALSE(foo.name().is_null()); | 322 ASSERT_FALSE(foo.name().is_null()); |
323 EXPECT_EQ("Fooby", foo.name().To<std::string>()); | 323 EXPECT_EQ("Fooby", foo.name().To<std::string>()); |
324 EXPECT_TRUE(foo.a()); | 324 EXPECT_TRUE(foo.a()); |
325 EXPECT_EQ(3u, foo.data().size()); | 325 EXPECT_EQ(3u, foo.data().size()); |
326 EXPECT_EQ(1, foo.data()[0]); | 326 EXPECT_EQ(1, foo.data()[0]); |
327 EXPECT_EQ(2, foo.data()[1]); | 327 EXPECT_EQ(2, foo.data()[1]); |
328 EXPECT_EQ(3, foo.data()[2]); | 328 EXPECT_EQ(3, foo.data()[2]); |
| 329 |
| 330 DefaultsTestInner inner = DefaultsTestInner::Builder().Finish(); |
| 331 EXPECT_EQ(1u, inner.names().size()); |
| 332 EXPECT_EQ("Jim", inner.names()[0].To<std::string>()); |
| 333 EXPECT_EQ(6*12, inner.height()); |
| 334 |
| 335 DefaultsTest full = DefaultsTest::Builder().Finish(); |
| 336 EXPECT_EQ(1u, full.people().size()); |
| 337 EXPECT_EQ(32, full.people()[0].age()); |
| 338 EXPECT_EQ(2u, full.people()[0].names().size()); |
| 339 EXPECT_EQ("Bob", full.people()[0].names()[0].To<std::string>()); |
| 340 EXPECT_EQ("Bobby", full.people()[0].names()[1].To<std::string>()); |
| 341 EXPECT_EQ(6*12, full.people()[0].height()); |
329 } | 342 } |
330 | 343 |
331 } // namespace sample | 344 } // namespace sample |
OLD | NEW |