Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: services/service_manager/public/cpp/tests/interface_registry_unittest.cc

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "services/service_manager/public/cpp/interface_registry.h" 5 #include "services/service_manager/public/cpp/interface_registry.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "services/service_manager/public/cpp/interface_binder.h" 8 #include "services/service_manager/public/cpp/interface_binder.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace shell { 11 namespace service_manager {
12 namespace internal { 12 namespace internal {
13 namespace { 13 namespace {
14 14
15 class TestBinder : public InterfaceBinder { 15 class TestBinder : public InterfaceBinder {
16 public: 16 public:
17 explicit TestBinder(int* delete_count) : delete_count_(delete_count) {} 17 explicit TestBinder(int* delete_count) : delete_count_(delete_count) {}
18 ~TestBinder() override { (*delete_count_)++; } 18 ~TestBinder() override { (*delete_count_)++; }
19 void BindInterface(const shell::Identity& remote_identity, 19 void BindInterface(const service_manager::Identity& remote_identity,
20 const std::string& interface_name, 20 const std::string& interface_name,
21 mojo::ScopedMessagePipeHandle client_handle) override {} 21 mojo::ScopedMessagePipeHandle client_handle) override {}
22 22
23 private: 23 private:
24 int* delete_count_; 24 int* delete_count_;
25 }; 25 };
26 26
27 TEST(InterfaceRegistryTest, Ownership) { 27 TEST(InterfaceRegistryTest, Ownership) {
28 base::MessageLoop message_loop_; 28 base::MessageLoop message_loop_;
29 int delete_count = 0; 29 int delete_count = 0;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 InterfaceRegistry::TestApi test_api(&registry); 62 InterfaceRegistry::TestApi test_api(&registry);
63 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); 63 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
64 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1"); 64 test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
65 EXPECT_EQ(5, delete_count); 65 EXPECT_EQ(5, delete_count);
66 } 66 }
67 EXPECT_EQ(6, delete_count); 67 EXPECT_EQ(6, delete_count);
68 } 68 }
69 69
70 } // namespace 70 } // namespace
71 } // namespace internal 71 } // namespace internal
72 } // namespace shell 72 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/public/cpp/service_test.h ('k') | services/service_manager/public/interfaces/capabilities.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698