OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 /* |
11 namespace { | 11 namespace { |
12 | 12 |
13 COMPILE_ASSERT(DefaultSingletonTraits<int>::kRegisterAtExit == true, a); | 13 COMPILE_ASSERT(DefaultSingletonTraits<int>::kRegisterAtExit == true, a); |
14 | 14 |
15 template<typename Type> | 15 template<typename Type> |
16 struct LockTrait : public DefaultSingletonTraits<Type> { | 16 struct LockTrait : public DefaultSingletonTraits<Type> { |
17 }; | 17 }; |
18 | 18 |
19 struct Init5Trait : public DefaultSingletonTraits<int> { | 19 struct Init5Trait : public DefaultSingletonTraits<int> { |
20 static int* New() { | 20 static int* New() { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 { | 235 { |
236 // Resurrect the static singleton, and assert that it | 236 // Resurrect the static singleton, and assert that it |
237 // still points to the same (static) memory. | 237 // still points to the same (static) memory. |
238 StaticMemorySingletonTraits<CallbackFunc>::Resurrect(); | 238 StaticMemorySingletonTraits<CallbackFunc>::Resurrect(); |
239 EXPECT_EQ(GetStaticSingleton(), static_singleton); | 239 EXPECT_EQ(GetStaticSingleton(), static_singleton); |
240 } | 240 } |
241 } | 241 } |
242 // The leaky singleton shouldn't leak since SingletonLeak has not been called. | 242 // The leaky singleton shouldn't leak since SingletonLeak has not been called. |
243 VerifiesCallbacksNotCalled(); | 243 VerifiesCallbacksNotCalled(); |
244 } | 244 } |
| 245 */ |
OLD | NEW |