Index: content/public/test/test_mojo_app.cc |
diff --git a/content/public/test/test_mojo_app.cc b/content/public/test/test_mojo_app.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bebb7a7623fed5b65f26e55ef6e882471061776e |
--- /dev/null |
+++ b/content/public/test/test_mojo_app.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/public/test/test_mojo_app.h" |
+ |
+#include "base/logging.h" |
+#include "mojo/application/public/cpp/application_connection.h" |
+#include "mojo/application/public/cpp/application_impl.h" |
+ |
+namespace content { |
+ |
+const char kTestMojoAppUrl[] = "system:content_mojo_test"; |
+ |
+TestMojoApp::TestMojoApp() : service_binding_(this), app_(nullptr) { |
+} |
+ |
+TestMojoApp::~TestMojoApp() { |
+} |
+ |
+void TestMojoApp::Initialize(mojo::ApplicationImpl* app) { |
+ app_ = app; |
+} |
+ |
+bool TestMojoApp::ConfigureIncomingConnection( |
+ mojo::ApplicationConnection* connection) { |
+ connection->AddService<TestMojoService>(this); |
+ return true; |
+} |
+ |
+void TestMojoApp::Create(mojo::ApplicationConnection* connection, |
+ mojo::InterfaceRequest<TestMojoService> request) { |
+ DCHECK(!service_binding_.is_bound()); |
+ service_binding_.Bind(request.Pass()); |
+} |
+ |
+void TestMojoApp::DoSomething(const DoSomethingCallback& callback) { |
+ callback.Run(); |
+ DCHECK(app_); |
+ app_->Terminate(); |
+} |
+ |
+} // namespace content |