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

Side by Side Diff: mojo/public/cpp/application/tests/service_registry_unittest.cc

Issue 617503003: Mojo: MOJO_OVERRIDE -> override in mojo/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 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 "mojo/public/cpp/application/lib/service_registry.h" 5 #include "mojo/public/cpp/application/lib/service_registry.h"
6 6
7 #include "mojo/public/cpp/application/lib/service_connector.h" 7 #include "mojo/public/cpp/application/lib/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 ServiceConnectorBase { 14 class TestConnector : public ServiceConnectorBase {
15 public: 15 public:
16 TestConnector(const std::string& name, int* delete_count) 16 TestConnector(const std::string& name, int* delete_count)
17 : ServiceConnectorBase(name), delete_count_(delete_count) {} 17 : ServiceConnectorBase(name), delete_count_(delete_count) {}
18 virtual ~TestConnector() { (*delete_count_)++; } 18 virtual ~TestConnector() { (*delete_count_)++; }
19 virtual void ConnectToService( 19 virtual void ConnectToService(
20 const std::string& name, 20 const std::string& name,
21 ScopedMessagePipeHandle client_handle) MOJO_OVERRIDE {} 21 ScopedMessagePipeHandle client_handle) override {}
22
22 private: 23 private:
23 int* delete_count_; 24 int* delete_count_;
24 }; 25 };
25 26
26 TEST(ServiceRegistryTest, Ownership) { 27 TEST(ServiceRegistryTest, Ownership) {
27 int delete_count = 0; 28 int delete_count = 0;
28 29
29 // Destruction. 30 // Destruction.
30 { 31 {
31 ServiceRegistry registry; 32 ServiceRegistry registry;
(...skipping 24 matching lines...) Expand all
56 registry.AddServiceConnector(new TestConnector("TC1", &delete_count)); 57 registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
57 registry.AddServiceConnector(new TestConnector("TC1", &delete_count)); 58 registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
58 EXPECT_EQ(5, delete_count); 59 EXPECT_EQ(5, delete_count);
59 } 60 }
60 EXPECT_EQ(6, delete_count); 61 EXPECT_EQ(6, delete_count);
61 } 62 }
62 63
63 } // namespace 64 } // namespace
64 } // namespace internal 65 } // namespace internal
65 } // namespace mojo 66 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/service_provider_impl.h ('k') | mojo/public/cpp/bindings/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698