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

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

Issue 2689513003: Add field-initializing constructors to generated mojo structs. (Closed)
Patch Set: rebase Created 3 years, 10 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/cpp/bindings/tests/equals_unittest.cc ('k') | mojo/public/cpp/bindings/tests/hash_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
index c420e041a9ded820b191bd5197d5a7dd39f223a5..21557a93be1c2484d68bcc4b2c13a0af55ebc285 100644
--- a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
@@ -95,9 +95,7 @@ class SampleFactoryImpl : public sample::Factory {
EXPECT_TRUE(WriteTextMessage(pipe1_.get(), text2));
}
- sample::ResponsePtr response(sample::Response::New());
- response->x = 2;
- response->pipe = std::move(pipe0);
+ sample::ResponsePtr response(sample::Response::New(2, std::move(pipe0)));
callback.Run(std::move(response), text1);
if (request->obj)
@@ -214,10 +212,8 @@ TEST_F(HandlePassingTest, Basic) {
ImportedInterfaceImpl imported_impl(MakeRequest(&imported),
run_loop.QuitClosure());
- sample::RequestPtr request(sample::Request::New());
- request->x = 1;
- request->pipe = std::move(pipe1.handle0);
- request->obj = std::move(imported);
+ sample::RequestPtr request(sample::Request::New(
+ 1, std::move(pipe1.handle0), base::nullopt, std::move(imported)));
bool got_response = false;
std::string got_text_reply;
base::RunLoop run_loop2;
@@ -240,8 +236,9 @@ TEST_F(HandlePassingTest, PassInvalid) {
sample::FactoryPtr factory;
SampleFactoryImpl factory_impl(MakeRequest(&factory));
- sample::RequestPtr request(sample::Request::New());
- request->x = 1;
+ sample::RequestPtr request(
+ sample::Request::New(1, ScopedMessagePipeHandle(), base::nullopt,
+ imported::ImportedInterfacePtr()));
bool got_response = false;
std::string got_text_reply;
base::RunLoop run_loop;
« no previous file with comments | « mojo/public/cpp/bindings/tests/equals_unittest.cc ('k') | mojo/public/cpp/bindings/tests/hash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698