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

Side by Side Diff: components/sync/base/proto_value_ptr_unittest.cc

Issue 2689773002: [Sync] Replace typedef with using. (Closed)
Patch Set: [Sync] Replace typedef with using. Created 3 years, 10 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
« no previous file with comments | « components/sync/base/progress_marker_map.h ('k') | components/sync/base/sync_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/sync/base/proto_value_ptr.h" 5 #include "components/sync/base/proto_value_ptr.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 DISALLOW_COPY_AND_ASSIGN(TestValue); 106 DISALLOW_COPY_AND_ASSIGN(TestValue);
107 }; 107 };
108 108
109 // Static initializers. 109 // Static initializers.
110 int TestValue::g_copy_count = 0; 110 int TestValue::g_copy_count = 0;
111 int TestValue::g_parse_count = 0; 111 int TestValue::g_parse_count = 0;
112 int TestValue::g_delete_count = 0; 112 int TestValue::g_delete_count = 0;
113 113
114 } // namespace 114 } // namespace
115 115
116 typedef ProtoValuePtr<TestValue> TestPtr; 116 using TestPtr = ProtoValuePtr<TestValue>;
117 117
118 class ProtoValuePtrTest : public testing::Test { 118 class ProtoValuePtrTest : public testing::Test {
119 public: 119 public:
120 void SetUp() override { TestValue::ResetCounters(); } 120 void SetUp() override { TestValue::ResetCounters(); }
121 121
122 static bool WrappedValuesAreShared(const TestPtr& ptr1, const TestPtr& ptr2) { 122 static bool WrappedValuesAreShared(const TestPtr& ptr1, const TestPtr& ptr2) {
123 const TestValue& wrapped_value_1 = ptr1.value(); 123 const TestValue& wrapped_value_1 = ptr1.value();
124 const TestValue& wrapped_value_2 = ptr2.value(); 124 const TestValue& wrapped_value_2 = ptr2.value();
125 // Compare addresses. 125 // Compare addresses.
126 return &wrapped_value_1 == &wrapped_value_2; 126 return &wrapped_value_1 == &wrapped_value_2;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 EXPECT_EQ(1, TestValue::parse_count()); 240 EXPECT_EQ(1, TestValue::parse_count());
241 EXPECT_EQ(0, TestValue::copy_count()); 241 EXPECT_EQ(0, TestValue::copy_count());
242 242
243 EXPECT_EQ(v1, ptr1->value()); 243 EXPECT_EQ(v1, ptr1->value());
244 } 244 }
245 245
246 EXPECT_EQ(1, TestValue::delete_count()); 246 EXPECT_EQ(1, TestValue::delete_count());
247 } 247 }
248 248
249 } // namespace syncer 249 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/progress_marker_map.h ('k') | components/sync/base/sync_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698