Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler_unittest.cc

Issue 2490183002: Filter webrtc::RTCStats by whitelist in surfacing them to Blink. (Closed)
Patch Set: git cl format: {\n} -> {} Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/media/webrtc/rtc_stats.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 14 matching lines...) Expand all
25 #include "content/renderer/media/media_stream_video_track.h" 25 #include "content/renderer/media/media_stream_video_track.h"
26 #include "content/renderer/media/mock_audio_device_factory.h" 26 #include "content/renderer/media/mock_audio_device_factory.h"
27 #include "content/renderer/media/mock_constraint_factory.h" 27 #include "content/renderer/media/mock_constraint_factory.h"
28 #include "content/renderer/media/mock_data_channel_impl.h" 28 #include "content/renderer/media/mock_data_channel_impl.h"
29 #include "content/renderer/media/mock_media_stream_video_source.h" 29 #include "content/renderer/media/mock_media_stream_video_source.h"
30 #include "content/renderer/media/mock_peer_connection_impl.h" 30 #include "content/renderer/media/mock_peer_connection_impl.h"
31 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" 31 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
32 #include "content/renderer/media/peer_connection_tracker.h" 32 #include "content/renderer/media/peer_connection_tracker.h"
33 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h" 33 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h"
34 #include "content/renderer/media/webrtc/processed_local_audio_source.h" 34 #include "content/renderer/media/webrtc/processed_local_audio_source.h"
35 #include "content/renderer/media/webrtc/rtc_stats.h"
35 #include "testing/gmock/include/gmock/gmock.h" 36 #include "testing/gmock/include/gmock/gmock.h"
36 #include "testing/gtest/include/gtest/gtest.h" 37 #include "testing/gtest/include/gtest/gtest.h"
37 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" 38 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
38 #include "third_party/WebKit/public/platform/WebMediaStream.h" 39 #include "third_party/WebKit/public/platform/WebMediaStream.h"
39 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 40 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
40 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 41 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
41 #include "third_party/WebKit/public/platform/WebRTCConfiguration.h" 42 #include "third_party/WebKit/public/platform/WebRTCConfiguration.h"
42 #include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h" 43 #include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h"
43 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h" 44 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h"
44 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" 45 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 new rtc::RefCountedObject<MockRTCStatsRequest>()); 666 new rtc::RefCountedObject<MockRTCStatsRequest>());
666 request->setSelector(component); 667 request->setSelector(component);
667 pc_handler_->getStats(request.get()); 668 pc_handler_->getStats(request.get());
668 base::RunLoop().RunUntilIdle(); 669 base::RunLoop().RunUntilIdle();
669 EXPECT_EQ(0, request->result()->report_count()); 670 EXPECT_EQ(0, request->result()->report_count());
670 671
671 StopAllTracks(local_stream); 672 StopAllTracks(local_stream);
672 } 673 }
673 674
674 TEST_F(RTCPeerConnectionHandlerTest, GetRTCStats) { 675 TEST_F(RTCPeerConnectionHandlerTest, GetRTCStats) {
676 WhitelistStatsForTesting(webrtc::RTCTestStats::kType);
677
675 rtc::scoped_refptr<webrtc::RTCStatsReport> report = 678 rtc::scoped_refptr<webrtc::RTCStatsReport> report =
676 webrtc::RTCStatsReport::Create(); 679 webrtc::RTCStatsReport::Create();
677 680
678 report->AddStats(std::unique_ptr<const webrtc::RTCStats>( 681 report->AddStats(std::unique_ptr<const webrtc::RTCStats>(
679 new webrtc::RTCTestStats("RTCUndefinedStats", 1000))); 682 new webrtc::RTCTestStats("RTCUndefinedStats", 1000)));
680 683
681 std::unique_ptr<webrtc::RTCTestStats> stats_defined_members( 684 std::unique_ptr<webrtc::RTCTestStats> stats_defined_members(
682 new webrtc::RTCTestStats("RTCDefinedStats", 2000)); 685 new webrtc::RTCTestStats("RTCDefinedStats", 2000));
683 stats_defined_members->m_bool = true; 686 stats_defined_members->m_bool = true;
684 stats_defined_members->m_int32 = 42; 687 stats_defined_members->m_int32 = 42;
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 testing::Ref(tracks[0]))); 1216 testing::Ref(tracks[0])));
1214 1217
1215 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender( 1218 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender(
1216 pc_handler_->createDTMFSender(tracks[0])); 1219 pc_handler_->createDTMFSender(tracks[0]));
1217 EXPECT_TRUE(sender.get()); 1220 EXPECT_TRUE(sender.get());
1218 1221
1219 StopAllTracks(local_stream); 1222 StopAllTracks(local_stream);
1220 } 1223 }
1221 1224
1222 } // namespace content 1225 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc/rtc_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698