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/bind.h" | 5 #include "base/bind.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/test/gtest_util.h" | 16 #include "base/test/gtest_util.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 using ::testing::_; | 21 using ::testing::_; |
22 using ::testing::Mock; | 22 using ::testing::Mock; |
23 using ::testing::ByMove; | 23 using ::testing::ByMove; |
24 using ::testing::Return; | 24 using ::testing::Return; |
25 using ::testing::StrictMock; | 25 using ::testing::StrictMock; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 | |
29 using internal::OnceCallback; | |
30 using internal::RepeatingCallback; | |
31 using internal::OnceClosure; | |
32 using internal::RepeatingClosure; | |
33 using internal::BindOnce; | |
34 using internal::BindRepeating; | |
35 | |
36 namespace { | 28 namespace { |
37 | 29 |
38 class IncompleteType; | 30 class IncompleteType; |
39 | 31 |
40 class NoRef { | 32 class NoRef { |
41 public: | 33 public: |
42 NoRef() {} | 34 NoRef() {} |
43 | 35 |
44 MOCK_METHOD0(VoidMethod0, void()); | 36 MOCK_METHOD0(VoidMethod0, void()); |
45 MOCK_CONST_METHOD0(VoidConstMethod0, void()); | 37 MOCK_CONST_METHOD0(VoidConstMethod0, void()); |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 | 1410 |
1419 // Test null callbacks cause a DCHECK. | 1411 // Test null callbacks cause a DCHECK. |
1420 TEST(BindDeathTest, NullCallback) { | 1412 TEST(BindDeathTest, NullCallback) { |
1421 base::Callback<void(int)> null_cb; | 1413 base::Callback<void(int)> null_cb; |
1422 ASSERT_TRUE(null_cb.is_null()); | 1414 ASSERT_TRUE(null_cb.is_null()); |
1423 EXPECT_DCHECK_DEATH(base::Bind(null_cb, 42)); | 1415 EXPECT_DCHECK_DEATH(base::Bind(null_cb, 42)); |
1424 } | 1416 } |
1425 | 1417 |
1426 } // namespace | 1418 } // namespace |
1427 } // namespace base | 1419 } // namespace base |
OLD | NEW |