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

Unified Diff: shell/shell_apptest.cc

Issue 1435153003: Add an ApplicationConnector interface, etc. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: grrr Created 5 years, 1 month 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: shell/shell_apptest.cc
diff --git a/shell/shell_apptest.cc b/shell/shell_apptest.cc
index 1011e241c7f8beb1ff3ee88af6959f862b320393..7bc5e85afb2baa471cdd928f5cc2bfdac3495b53 100644
--- a/shell/shell_apptest.cc
+++ b/shell/shell_apptest.cc
@@ -13,7 +13,9 @@
#include "mojo/data_pipe_utils/data_pipe_utils.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/application_test_base.h"
+#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/cpp/system/macros.h"
+#include "mojo/public/interfaces/application/application_connector.mojom.h"
#include "mojo/services/http_server/cpp/http_server_util.h"
#include "mojo/services/http_server/interfaces/http_server.mojom.h"
#include "mojo/services/http_server/interfaces/http_server_factory.mojom.h"
@@ -195,4 +197,21 @@ TEST_F(ShellAppTest, MojoURLQueryHandling) {
base::RunLoop().Run();
}
+TEST_F(ShellAppTest, ApplicationConnector) {
+ mojo::ApplicationConnectorPtr app_connector;
+ app_connector.Bind(application_impl()->CreateApplicationConnector());
+
+ PingablePtr pingable;
+ ConnectToService(app_connector.get(), "mojo:pingable_app", &pingable);
+ auto callback = [this](const String& app_url, const String& connection_url,
+ const String& message) {
+ EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true));
+ EXPECT_EQ(app_url, connection_url);
+ EXPECT_EQ("hello", message);
+ base::MessageLoop::current()->Quit();
+ };
+ pingable->Ping("hello", callback);
+ base::RunLoop().Run();
+}
+
} // namespace
« mojo/go/tests/application_impl_test.go ('K') | « shell/application_manager/shell_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698