OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // /* We want to monitor foo in some test. Note how signal argument is | 28 // /* We want to monitor foo in some test. Note how signal argument is |
29 // const std::string&, but capture-type is std::string. Capture type | 29 // const std::string&, but capture-type is std::string. Capture type |
30 // must be type that can be assigned to. */ | 30 // must be type that can be assigned to. */ |
31 // std::string capture; | 31 // std::string capture; |
32 // SigslotTester1<const std::string&, std::string> slot(&foo, &capture); | 32 // SigslotTester1<const std::string&, std::string> slot(&foo, &capture); |
33 // foo.emit("hello"); | 33 // foo.emit("hello"); |
34 // EXPECT_EQ(1, slot.callback_count()); | 34 // EXPECT_EQ(1, slot.callback_count()); |
35 // EXPECT_EQ("hello", capture); | 35 // EXPECT_EQ("hello", capture); |
36 // /* See unit-tests for more examples */ | 36 // /* See unit-tests for more examples */ |
37 | 37 |
38 #include "webrtc/rtc_base/constructormagic.h" | 38 #include "webrtc/base/constructormagic.h" |
39 #include "webrtc/rtc_base/sigslot.h" | 39 #include "webrtc/base/sigslot.h" |
40 | 40 |
41 namespace rtc { | 41 namespace rtc { |
42 | 42 |
43 // Base version for testing signals that passes no arguments. | 43 // Base version for testing signals that passes no arguments. |
44 class SigslotTester0 : public sigslot::has_slots<> { | 44 class SigslotTester0 : public sigslot::has_slots<> { |
45 public: | 45 public: |
46 explicit SigslotTester0(sigslot::signal0<>* signal) : callback_count_(0) { | 46 explicit SigslotTester0(sigslot::signal0<>* signal) : callback_count_(0) { |
47 signal->connect(this, &SigslotTester0::OnSignalCallback); | 47 signal->connect(this, &SigslotTester0::OnSignalCallback); |
48 } | 48 } |
49 | 49 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 C$j* capture$j[[]]_;]] | 93 C$j* capture$j[[]]_;]] |
94 | 94 |
95 | 95 |
96 RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester$i); | 96 RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester$i); |
97 }; | 97 }; |
98 | 98 |
99 ]] | 99 ]] |
100 } // namespace rtc | 100 } // namespace rtc |
101 | 101 |
102 #endif // WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ | 102 #endif // WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ |
OLD | NEW |