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/public/cpp/application/lib/service_registry.h" | 5 #include "mojo/application/public/cpp/lib/service_registry.h" |
6 | 6 |
7 #include "mojo/public/cpp/application/service_connector.h" | 7 #include "mojo/application/public/cpp/service_connector.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 namespace internal { | 11 namespace internal { |
12 namespace { | 12 namespace { |
13 | 13 |
14 class TestConnector : public ServiceConnector { | 14 class TestConnector : public ServiceConnector { |
15 public: | 15 public: |
16 explicit TestConnector(int* delete_count) : delete_count_(delete_count) {} | 16 explicit TestConnector(int* delete_count) : delete_count_(delete_count) {} |
17 ~TestConnector() override { (*delete_count_)++; } | 17 ~TestConnector() override { (*delete_count_)++; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 registry.SetServiceConnectorForName(new TestConnector(&delete_count), | 61 registry.SetServiceConnectorForName(new TestConnector(&delete_count), |
62 "TC1"); | 62 "TC1"); |
63 EXPECT_EQ(5, delete_count); | 63 EXPECT_EQ(5, delete_count); |
64 } | 64 } |
65 EXPECT_EQ(6, delete_count); | 65 EXPECT_EQ(6, delete_count); |
66 } | 66 } |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 } // namespace internal | 69 } // namespace internal |
70 } // namespace mojo | 70 } // namespace mojo |
OLD | NEW |