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

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

Issue 317073005: Mojom: Add 'default' keyword for initializing structs to non-null value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
Index: mojo/public/cpp/bindings/tests/sample_service_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
index a079d299a715d48859adfe7c3f0389aa836ce618..23b0dbdf06f4aacc572c13dee81adcd0298cada1 100644
--- a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
@@ -359,9 +359,11 @@ TEST(BindingsSampleTest, DefaultValues) {
EXPECT_DOUBLE_EQ(1.23E-20, defaults->a17);
EXPECT_TRUE(defaults->a18.is_null());
EXPECT_TRUE(defaults->a19.is_null());
- // TODO(mpcomplete): Test defaults.Point and defaults.Thing once we can
- // initialize them to "default".
EXPECT_EQ(Bar::TYPE_BOTH, defaults->a20);
+ EXPECT_TRUE(defaults->a21.is_null());
+ ASSERT_FALSE(defaults->a22.is_null());
+ EXPECT_EQ(imported::SHAPE_RECTANGLE, defaults->a22->shape);
+ EXPECT_EQ(imported::COLOR_BLACK, defaults->a22->color);
}
} // namespace
« no previous file with comments | « mojo/apps/js/bindings/sample_service_unittests.js ('k') | mojo/public/interfaces/bindings/tests/sample_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698