| Index: mojo/shell/tests/connect/connect_test_app.cc
|
| diff --git a/mojo/shell/tests/connect/connect_test_app.cc b/mojo/shell/tests/connect/connect_test_app.cc
|
| index 86ae2351da627b625431e1abd80f0b101f141872..abf51dcad5030c459a6623b21d88662d555190cb 100644
|
| --- a/mojo/shell/tests/connect/connect_test_app.cc
|
| +++ b/mojo/shell/tests/connect/connect_test_app.cc
|
| @@ -17,6 +17,13 @@
|
|
|
| namespace mojo {
|
| namespace shell {
|
| +namespace {
|
| +void ReceiveString(std::string* string, base::RunLoop* loop,
|
| + const std::string& response) {
|
| + *string = response;
|
| + loop->Quit();
|
| +}
|
| +}
|
|
|
| using GetTitleCallback = test::mojom::ConnectTestService::GetTitleCallback;
|
|
|
| @@ -119,6 +126,32 @@ class ConnectTestApp : public ShellClient,
|
| run_loop.Run();
|
| }
|
| }
|
| + void ConnectToClassInterface(
|
| + const ConnectToClassInterfaceCallback& callback) override {
|
| + scoped_ptr<Connection> connection =
|
| + connector_->Connect("mojo:connect_test_class_app");
|
| + test::mojom::ClassInterfacePtr class_interface;
|
| + connection->GetInterface(&class_interface);
|
| + std::string ping_response;
|
| + {
|
| + base::RunLoop loop;
|
| + class_interface->Ping(base::Bind(&ReceiveString, &ping_response, &loop));
|
| + base::MessageLoop::ScopedNestableTaskAllower allow(
|
| + base::MessageLoop::current());
|
| + loop.Run();
|
| + }
|
| + test::mojom::ConnectTestServicePtr service;
|
| + connection->GetInterface(&service);
|
| + std::string title_response;
|
| + {
|
| + base::RunLoop loop;
|
| + service->GetTitle(base::Bind(&ReceiveString, &title_response, &loop));
|
| + base::MessageLoop::ScopedNestableTaskAllower allow(
|
| + base::MessageLoop::current());
|
| + loop.Run();
|
| + }
|
| + callback.Run(ping_response, title_response);
|
| + }
|
|
|
| // test::mojom::BlockedInterface:
|
| void GetTitleBlocked(const GetTitleBlockedCallback& callback) override {
|
|
|