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

Side by Side Diff: base/memory/singleton_unittest.cc

Issue 804533005: Standardize usage of virtual/override/final specifiers in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/memory/singleton.h" 6 #include "base/memory/singleton.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 CallbackFunc* GetStaticSingleton() { 146 CallbackFunc* GetStaticSingleton() {
147 return &CallbackSingletonWithStaticTrait::GetInstance()->callback_; 147 return &CallbackSingletonWithStaticTrait::GetInstance()->callback_;
148 } 148 }
149 149
150 } // namespace 150 } // namespace
151 151
152 class SingletonTest : public testing::Test { 152 class SingletonTest : public testing::Test {
153 public: 153 public:
154 SingletonTest() {} 154 SingletonTest() {}
155 155
156 virtual void SetUp() override { 156 void SetUp() override {
157 non_leak_called_ = false; 157 non_leak_called_ = false;
158 leaky_called_ = false; 158 leaky_called_ = false;
159 static_called_ = false; 159 static_called_ = false;
160 } 160 }
161 161
162 protected: 162 protected:
163 void VerifiesCallbacks() { 163 void VerifiesCallbacks() {
164 EXPECT_TRUE(non_leak_called_); 164 EXPECT_TRUE(non_leak_called_);
165 EXPECT_FALSE(leaky_called_); 165 EXPECT_FALSE(leaky_called_);
166 EXPECT_TRUE(static_called_); 166 EXPECT_TRUE(static_called_);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 AlignedTestSingleton<AlignedMemory<128, 128> >* align128 = 278 AlignedTestSingleton<AlignedMemory<128, 128> >* align128 =
279 AlignedTestSingleton<AlignedMemory<128, 128> >::GetInstance(); 279 AlignedTestSingleton<AlignedMemory<128, 128> >::GetInstance();
280 AlignedTestSingleton<AlignedMemory<4096, 4096> >* align4096 = 280 AlignedTestSingleton<AlignedMemory<4096, 4096> >* align4096 =
281 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance(); 281 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance();
282 282
283 EXPECT_ALIGNED(align4, 4); 283 EXPECT_ALIGNED(align4, 4);
284 EXPECT_ALIGNED(align32, 32); 284 EXPECT_ALIGNED(align32, 32);
285 EXPECT_ALIGNED(align128, 128); 285 EXPECT_ALIGNED(align128, 128);
286 EXPECT_ALIGNED(align4096, 4096); 286 EXPECT_ALIGNED(align4096, 4096);
287 } 287 }
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_shmem_allocator.cc ('k') | base/message_loop/message_loop_proxy_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698