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

Unified Diff: services/js/echo_apptest.cc

Issue 845593003: Pass ServiceProvider and ServiceProvider& params in Connect (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: use nullptr instead of ServiceProviderPtr(), fix ShellImpl Created 5 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/services/public/js/application.js ('k') | shell/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/js/echo_apptest.cc
diff --git a/services/js/echo_apptest.cc b/services/js/echo_apptest.cc
index 0a2bf3588049b38f330c951ce18c0faaf8c057c3..cccd9c6c200c6f6dc8c65686e6158d4347f72413 100644
--- a/services/js/echo_apptest.cc
+++ b/services/js/echo_apptest.cc
@@ -39,8 +39,16 @@ class JSServiceProviderEchoTest : public test::JSApplicationTestBase {
void SetUp() override {
ApplicationTestBase::SetUp();
const std::string& url = JSAppURL("echo.js");
+ // TODO(hansmuller): We should be able to pass a null ServiceProviderPtr
+ // here as the third parameter to ConnectToApplication since the parameter
+ // is annotated as nullable in the mojom, but the JS bindings currently
+ // don't correctly handle a null handle. So instead we allocate (and
+ // immediately close) a MessagePipe.
+ mojo::MessagePipe throwaway_pipe;
+ mojo::ServiceProviderPtr exposed_services;
+ exposed_services.Bind(throwaway_pipe.handle0.Pass());
application_impl()->shell()->ConnectToApplication(
- url, GetProxy(&echo_service_provider_));
+ url, GetProxy(&echo_service_provider_), exposed_services.Pass());
}
mojo::ServiceProviderPtr echo_service_provider_;
« no previous file with comments | « mojo/services/public/js/application.js ('k') | shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698