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

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

Issue 10004001: Add virtual and OVERRIDE to base/ implementation files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win Fix -> Missing header Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « base/memory/scoped_vector_unittest.cc ('k') | base/memory/weak_ptr_unittest.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_util.h" 6 #include "base/file_util.h"
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 CallbackFunc* GetStaticSingleton() { 148 CallbackFunc* GetStaticSingleton() {
149 return &CallbackSingletonWithStaticTrait::GetInstance()->callback_; 149 return &CallbackSingletonWithStaticTrait::GetInstance()->callback_;
150 } 150 }
151 151
152 } // namespace 152 } // namespace
153 153
154 class SingletonTest : public testing::Test { 154 class SingletonTest : public testing::Test {
155 public: 155 public:
156 SingletonTest() { } 156 SingletonTest() {}
157 157
158 virtual void SetUp() { 158 virtual void SetUp() OVERRIDE {
159 non_leak_called_ = false; 159 non_leak_called_ = false;
160 leaky_called_ = false; 160 leaky_called_ = false;
161 static_called_ = false; 161 static_called_ = false;
162 } 162 }
163 163
164 protected: 164 protected:
165 void VerifiesCallbacks() { 165 void VerifiesCallbacks() {
166 EXPECT_TRUE(non_leak_called_); 166 EXPECT_TRUE(non_leak_called_);
167 EXPECT_FALSE(leaky_called_); 167 EXPECT_FALSE(leaky_called_);
168 EXPECT_TRUE(static_called_); 168 EXPECT_TRUE(static_called_);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 AlignedTestSingleton<AlignedMemory<128, 128> >* align128 = 280 AlignedTestSingleton<AlignedMemory<128, 128> >* align128 =
281 AlignedTestSingleton<AlignedMemory<128, 128> >::GetInstance(); 281 AlignedTestSingleton<AlignedMemory<128, 128> >::GetInstance();
282 AlignedTestSingleton<AlignedMemory<4096, 4096> >* align4096 = 282 AlignedTestSingleton<AlignedMemory<4096, 4096> >* align4096 =
283 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance(); 283 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance();
284 284
285 EXPECT_ALIGNED(align4, 4); 285 EXPECT_ALIGNED(align4, 4);
286 EXPECT_ALIGNED(align32, 32); 286 EXPECT_ALIGNED(align32, 32);
287 EXPECT_ALIGNED(align128, 128); 287 EXPECT_ALIGNED(align128, 128);
288 EXPECT_ALIGNED(align4096, 4096); 288 EXPECT_ALIGNED(align4096, 4096);
289 } 289 }
OLDNEW
« no previous file with comments | « base/memory/scoped_vector_unittest.cc ('k') | base/memory/weak_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698