OLD | NEW |
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/callback.h" |
| 6 |
| 7 #include <memory> |
| 8 |
5 #include "base/bind.h" | 9 #include "base/bind.h" |
6 #include "base/callback.h" | |
7 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
8 #include "base/callback_internal.h" | 11 #include "base/callback_internal.h" |
9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 | 14 |
13 namespace base { | 15 namespace base { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 struct FakeInvoker { | 19 struct FakeInvoker { |
18 // MSVC 2013 doesn't support Type Alias of function types. | 20 // MSVC 2013 doesn't support Type Alias of function types. |
19 // Revisit this after we update it to newer version. | 21 // Revisit this after we update it to newer version. |
20 typedef void RunType(internal::BindStateBase*); | 22 typedef void RunType(internal::BindStateBase*); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 182 |
181 TEST_F(CallbackTest, CallbackHasLastRefOnContainingObject) { | 183 TEST_F(CallbackTest, CallbackHasLastRefOnContainingObject) { |
182 bool deleted = false; | 184 bool deleted = false; |
183 CallbackOwner* owner = new CallbackOwner(&deleted); | 185 CallbackOwner* owner = new CallbackOwner(&deleted); |
184 owner->Reset(); | 186 owner->Reset(); |
185 ASSERT_TRUE(deleted); | 187 ASSERT_TRUE(deleted); |
186 } | 188 } |
187 | 189 |
188 } // namespace | 190 } // namespace |
189 } // namespace base | 191 } // namespace base |
OLD | NEW |