OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "mojo/examples/apptest/example_client_application.h" |
5 #include "mojo/examples/apptest/example_client_impl.h" | 6 #include "mojo/examples/apptest/example_client_impl.h" |
6 #include "mojo/examples/apptest/example_service.mojom.h" | 7 #include "mojo/examples/apptest/example_service.mojom.h" |
7 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/application_export.h" |
8 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
9 #include "mojo/public/cpp/bindings/callback.h" | 11 #include "mojo/public/cpp/bindings/callback.h" |
10 #include "mojo/public/cpp/environment/environment.h" | 12 #include "mojo/public/cpp/environment/environment.h" |
11 #include "mojo/public/cpp/system/macros.h" | 13 #include "mojo/public/cpp/system/macros.h" |
12 #include "mojo/public/cpp/utility/run_loop.h" | 14 #include "mojo/public/cpp/utility/run_loop.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // TODO(msw): Remove this once we can get ApplicationImpl from TLS. | 19 // TODO(msw): Remove this once we can get ApplicationImpl from TLS. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 71 |
70 } // namespace | 72 } // namespace |
71 | 73 |
72 } // namespace mojo | 74 } // namespace mojo |
73 | 75 |
74 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( | 76 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( |
75 MojoHandle shell_handle) { | 77 MojoHandle shell_handle) { |
76 mojo::Environment env; | 78 mojo::Environment env; |
77 mojo::RunLoop loop; | 79 mojo::RunLoop loop; |
78 | 80 |
79 mojo::ApplicationDelegate* delegate = mojo::ApplicationDelegate::Create(); | 81 // TODO(tim): Perhaps the delegate should be the thing that provides |
80 mojo::ApplicationImpl app(delegate); | 82 // the ExampleServiceTest with the ApplicationImpl somehow. |
81 app.BindShell(shell_handle); | 83 mojo::ApplicationDelegate* delegate = new mojo::ExampleClientApplication(); |
| 84 mojo::ApplicationImpl app(delegate, shell_handle); |
82 g_application_impl_hack = &app; | 85 g_application_impl_hack = &app; |
83 | 86 |
84 // TODO(msw): Get actual commandline arguments. | 87 // TODO(msw): Get actual commandline arguments. |
85 int argc = 0; | 88 int argc = 0; |
86 char** argv = NULL; | 89 char** argv = NULL; |
87 testing::InitGoogleTest(&argc, argv); | 90 testing::InitGoogleTest(&argc, argv); |
88 mojo_ignore_result(RUN_ALL_TESTS()); | 91 mojo_ignore_result(RUN_ALL_TESTS()); |
89 | 92 |
90 delete delegate; | 93 delete delegate; |
91 return MOJO_RESULT_OK; | 94 return MOJO_RESULT_OK; |
92 } | 95 } |
OLD | NEW |