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

Unified Diff: mojo/public/bindings/tests/sample_service_unittest.cc

Issue 139613005: Support default values for complex objects in mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/bindings/tests/sample_service.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/tests/sample_service_unittest.cc
diff --git a/mojo/public/bindings/tests/sample_service_unittest.cc b/mojo/public/bindings/tests/sample_service_unittest.cc
index c04e6b59827d5c5767cb89e875d1d49830c9a7c7..ad3fee41e7b3354831b4d8e22cfa381316ad1b7a 100644
--- a/mojo/public/bindings/tests/sample_service_unittest.cc
+++ b/mojo/public/bindings/tests/sample_service_unittest.cc
@@ -326,6 +326,19 @@ TEST(BindingsSampleTest, DefaultValues) {
EXPECT_EQ(1, foo.data()[0]);
EXPECT_EQ(2, foo.data()[1]);
EXPECT_EQ(3, foo.data()[2]);
+
+ DefaultsTestInner inner = DefaultsTestInner::Builder().Finish();
+ EXPECT_EQ(1u, inner.names().size());
+ EXPECT_EQ("Jim", inner.names()[0].To<std::string>());
+ EXPECT_EQ(6*12, inner.height());
+
+ DefaultsTest full = DefaultsTest::Builder().Finish();
+ EXPECT_EQ(1u, full.people().size());
+ EXPECT_EQ(32, full.people()[0].age());
+ EXPECT_EQ(2u, full.people()[0].names().size());
+ EXPECT_EQ("Bob", full.people()[0].names()[0].To<std::string>());
+ EXPECT_EQ("Bobby", full.people()[0].names()[1].To<std::string>());
+ EXPECT_EQ(6*12, full.people()[0].height());
}
} // namespace sample
« no previous file with comments | « mojo/public/bindings/tests/sample_service.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698