1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/test/test_mojo_app.h"
7 #include "base/logging.h"
8 #include "mojo/application/public/cpp/application_connection.h"
9 #include "mojo/application/public/cpp/application_impl.h"
13 const char kTestMojoAppUrl
[] = "system:content_mojo_test";
15 TestMojoApp::TestMojoApp() : service_binding_(this), app_(nullptr) {
18 TestMojoApp::~TestMojoApp() {
21 void TestMojoApp::Initialize(mojo::ApplicationImpl
* app
) {
25 bool TestMojoApp::ConfigureIncomingConnection(
26 mojo::ApplicationConnection
* connection
) {
27 requestor_url_
= GURL(connection
->GetRemoteApplicationURL());
28 connection
->AddService
<TestMojoService
>(this);
32 void TestMojoApp::Create(mojo::ApplicationConnection
* connection
,
33 mojo::InterfaceRequest
<TestMojoService
> request
) {
34 DCHECK(!service_binding_
.is_bound());
35 service_binding_
.Bind(request
.Pass());
38 void TestMojoApp::DoSomething(const DoSomethingCallback
& callback
) {
44 void TestMojoApp::GetRequestorURL(const GetRequestorURLCallback
& callback
) {
45 callback
.Run(requestor_url_
.spec());
48 } // namespace content