OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 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 |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" | 14 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" |
15 #include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" | 15 #include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" |
16 #include "webrtc/api/datachannelinterface.h" | 16 #include "webrtc/api/datachannelinterface.h" |
17 #include "webrtc/api/peerconnectioninterface.h" | 17 #include "webrtc/api/peerconnectioninterface.h" |
18 #include "webrtc/api/stats/rtcstats_objects.h" | 18 #include "webrtc/api/stats/rtcstats_objects.h" |
19 #include "webrtc/api/stats/rtcstatsreport.h" | 19 #include "webrtc/api/stats/rtcstatsreport.h" |
20 #include "webrtc/pc/test/peerconnectiontestwrapper.h" | 20 #include "webrtc/pc/test/peerconnectiontestwrapper.h" |
21 #include "webrtc/pc/test/rtcstatsobtainer.h" | 21 #include "webrtc/pc/test/rtcstatsobtainer.h" |
22 #include "webrtc/rtc_base/checks.h" | 22 #include "webrtc/rtc_base/checks.h" |
23 #include "webrtc/rtc_base/event_tracer.h" | |
23 #include "webrtc/rtc_base/gunit.h" | 24 #include "webrtc/rtc_base/gunit.h" |
24 #include "webrtc/rtc_base/refcountedobject.h" | 25 #include "webrtc/rtc_base/refcountedobject.h" |
25 #include "webrtc/rtc_base/scoped_ref_ptr.h" | 26 #include "webrtc/rtc_base/scoped_ref_ptr.h" |
26 #include "webrtc/rtc_base/virtualsocketserver.h" | 27 #include "webrtc/rtc_base/virtualsocketserver.h" |
27 | 28 |
28 namespace webrtc { | 29 namespace webrtc { |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 const int64_t kGetStatsTimeoutMs = 10000; | 33 const int64_t kGetStatsTimeoutMs = 10000; |
34 const unsigned char* kWebRTCStatsCategory = | |
35 reinterpret_cast<const unsigned char*>("webrtc_stats"); | |
tommi
2017/07/18 12:22:54
static_cast, however the cast shouldn't be here.
ehmaldonado_webrtc
2017/07/18 12:36:19
I get:
error: static_cast from 'const char *' to
| |
36 | |
37 static const unsigned char* GetCategoryEnabledHandler(const char* name) { | |
38 return kWebRTCStatsCategory; | |
39 } | |
40 | |
41 static void AddTraceEventHandler(char phase, | |
42 const unsigned char* category_enabled, | |
43 const char* name, | |
44 unsigned long long id, | |
45 int num_args, | |
46 const char** arg_names, | |
47 const unsigned char* arg_types, | |
48 const unsigned long long* arg_values, | |
49 unsigned char flags) { | |
50 // Do nothing | |
51 } | |
33 | 52 |
34 class RTCStatsIntegrationTest : public testing::Test { | 53 class RTCStatsIntegrationTest : public testing::Test { |
35 public: | 54 public: |
36 RTCStatsIntegrationTest() | 55 RTCStatsIntegrationTest() |
37 : network_thread_(new rtc::Thread(&virtual_socket_server_)), | 56 : network_thread_(new rtc::Thread(&virtual_socket_server_)), |
38 worker_thread_(rtc::Thread::Create()) { | 57 worker_thread_(rtc::Thread::Create()) { |
58 SetupEventTracer(&GetCategoryEnabledHandler, &AddTraceEventHandler); | |
59 | |
39 RTC_CHECK(network_thread_->Start()); | 60 RTC_CHECK(network_thread_->Start()); |
40 RTC_CHECK(worker_thread_->Start()); | 61 RTC_CHECK(worker_thread_->Start()); |
41 | 62 |
42 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( | 63 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( |
43 "caller", network_thread_.get(), worker_thread_.get()); | 64 "caller", network_thread_.get(), worker_thread_.get()); |
44 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( | 65 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( |
45 "callee", network_thread_.get(), worker_thread_.get()); | 66 "callee", network_thread_.get(), worker_thread_.get()); |
46 } | 67 } |
47 | 68 |
48 void StartCall() { | 69 void StartCall() { |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 caller_ = nullptr; | 671 caller_ = nullptr; |
651 // Any pending stats requests should have completed in the act of destroying | 672 // Any pending stats requests should have completed in the act of destroying |
652 // the peer connection. | 673 // the peer connection. |
653 EXPECT_TRUE(stats_obtainer->report()); | 674 EXPECT_TRUE(stats_obtainer->report()); |
654 } | 675 } |
655 #endif // HAVE_SCTP | 676 #endif // HAVE_SCTP |
656 | 677 |
657 } // namespace | 678 } // namespace |
658 | 679 |
659 } // namespace webrtc | 680 } // namespace webrtc |
OLD | NEW |