| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "services/service_manager/public/cpp/connection.h" | 8 #include "services/service_manager/public/cpp/connection.h" |
| 9 #include "services/service_manager/public/cpp/connector.h" | 9 #include "services/service_manager/public/cpp/connector.h" |
| 10 #include "services/service_manager/public/cpp/service.h" | 10 #include "services/service_manager/public/cpp/service.h" |
| 11 #include "services/service_manager/runner/child/test_native_main.h" | 11 #include "services/service_manager/runner/child/test_native_main.h" |
| 12 #include "services/service_manager/runner/init.h" | 12 #include "services/service_manager/runner/init.h" |
| 13 #include "services/service_manager/tests/shell/shell_unittest.mojom.h" | 13 #include "services/service_manager/tests/shell/shell_unittest.mojom.h" |
| 14 | 14 |
| 15 using shell::test::mojom::CreateInstanceTestPtr; | 15 using service_manager::test::mojom::CreateInstanceTestPtr; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 class Target : public shell::Service { | 19 class Target : public service_manager::Service { |
| 20 public: | 20 public: |
| 21 Target() {} | 21 Target() {} |
| 22 ~Target() override {} | 22 ~Target() override {} |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // shell::Service: | 25 // service_manager::Service: |
| 26 void OnStart(const shell::Identity& identity) override { | 26 void OnStart(const service_manager::Identity& identity) override { |
| 27 CreateInstanceTestPtr service; | 27 CreateInstanceTestPtr service; |
| 28 connector()->ConnectToInterface("service:shell_unittest", &service); | 28 connector()->ConnectToInterface("service:shell_unittest", &service); |
| 29 service->SetTargetIdentity(identity); | 29 service->SetTargetIdentity(identity); |
| 30 } | 30 } |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(Target); | 32 DISALLOW_COPY_AND_ASSIGN(Target); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 int main(int argc, char** argv) { | 37 int main(int argc, char** argv) { |
| 38 base::AtExitManager at_exit; | 38 base::AtExitManager at_exit; |
| 39 base::CommandLine::Init(argc, argv); | 39 base::CommandLine::Init(argc, argv); |
| 40 | 40 |
| 41 shell::InitializeLogging(); | 41 service_manager::InitializeLogging(); |
| 42 | 42 |
| 43 Target target; | 43 Target target; |
| 44 return shell::TestNativeMain(&target); | 44 return service_manager::TestNativeMain(&target); |
| 45 } | 45 } |
| OLD | NEW |