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/shell/public/cpp/interface_registry.h" | 5 #include "services/shell/public/cpp/interface_registry.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/shell/public/cpp/interface_binder.h" | 9 #include "services/shell/public/cpp/interface_binder.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace internal { | 13 namespace internal { |
14 namespace { | 14 namespace { |
15 | 15 |
16 class TestBinder : public InterfaceBinder { | 16 class TestBinder : public InterfaceBinder { |
17 public: | 17 public: |
18 explicit TestBinder(int* delete_count) : delete_count_(delete_count) {} | 18 explicit TestBinder(int* delete_count) : delete_count_(delete_count) {} |
19 ~TestBinder() override { (*delete_count_)++; } | 19 ~TestBinder() override { (*delete_count_)++; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); | 64 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); |
65 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); | 65 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); |
66 EXPECT_EQ(5, delete_count); | 66 EXPECT_EQ(5, delete_count); |
67 } | 67 } |
68 EXPECT_EQ(6, delete_count); | 68 EXPECT_EQ(6, delete_count); |
69 } | 69 } |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 } // namespace internal | 72 } // namespace internal |
73 } // namespace mojo | 73 } // namespace mojo |
OLD | NEW |