OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "talk/app/webrtc/statscollector.h" | 30 #include "talk/app/webrtc/statscollector.h" |
31 | 31 |
32 #include "talk/app/webrtc/mediastream.h" | 32 #include "talk/app/webrtc/mediastream.h" |
33 #include "talk/app/webrtc/mediastreaminterface.h" | 33 #include "talk/app/webrtc/mediastreaminterface.h" |
34 #include "talk/app/webrtc/mediastreamsignaling.h" | 34 #include "talk/app/webrtc/mediastreamsignaling.h" |
35 #include "talk/app/webrtc/mediastreamtrack.h" | 35 #include "talk/app/webrtc/mediastreamtrack.h" |
36 #include "talk/app/webrtc/test/fakedatachannelprovider.h" | 36 #include "talk/app/webrtc/test/fakedatachannelprovider.h" |
37 #include "talk/app/webrtc/test/fakemediastreamsignaling.h" | 37 #include "talk/app/webrtc/test/fakemediastreamsignaling.h" |
38 #include "talk/app/webrtc/videotrack.h" | 38 #include "talk/app/webrtc/videotrack.h" |
39 #include "talk/media/base/fakemediaengine.h" | 39 #include "talk/media/base/fakemediaengine.h" |
40 #include "talk/media/devices/fakedevicemanager.h" | |
41 #include "talk/session/media/channelmanager.h" | 40 #include "talk/session/media/channelmanager.h" |
42 #include "testing/gmock/include/gmock/gmock.h" | 41 #include "testing/gmock/include/gmock/gmock.h" |
43 #include "testing/gtest/include/gtest/gtest.h" | 42 #include "testing/gtest/include/gtest/gtest.h" |
44 #include "webrtc/base/base64.h" | 43 #include "webrtc/base/base64.h" |
45 #include "webrtc/base/fakesslidentity.h" | 44 #include "webrtc/base/fakesslidentity.h" |
46 #include "webrtc/base/gunit.h" | 45 #include "webrtc/base/gunit.h" |
47 #include "webrtc/base/network.h" | 46 #include "webrtc/base/network.h" |
48 #include "webrtc/p2p/base/fakesession.h" | 47 #include "webrtc/p2p/base/fakesession.h" |
49 | 48 |
50 using rtc::scoped_ptr; | 49 using rtc::scoped_ptr; |
51 using testing::_; | 50 using testing::_; |
52 using testing::DoAll; | 51 using testing::DoAll; |
53 using testing::Field; | 52 using testing::Field; |
54 using testing::Return; | 53 using testing::Return; |
55 using testing::ReturnNull; | 54 using testing::ReturnNull; |
56 using testing::SetArgPointee; | 55 using testing::SetArgPointee; |
57 using webrtc::PeerConnectionInterface; | 56 using webrtc::PeerConnectionInterface; |
58 using webrtc::StatsReport; | 57 using webrtc::StatsReport; |
59 using webrtc::StatsReports; | 58 using webrtc::StatsReports; |
60 | 59 |
61 namespace cricket { | 60 namespace cricket { |
62 | 61 |
63 class ChannelManager; | 62 class ChannelManager; |
64 class FakeDeviceManager; | |
65 | 63 |
66 } // namespace cricket | 64 } // namespace cricket |
67 | 65 |
68 namespace webrtc { | 66 namespace webrtc { |
69 | 67 |
70 // Error return values | 68 // Error return values |
71 const char kNotFound[] = "NOT FOUND"; | 69 const char kNotFound[] = "NOT FOUND"; |
72 | 70 |
73 // Constant names for track identification. | 71 // Constant names for track identification. |
74 const char kLocalTrackId[] = "local_track_id"; | 72 const char kLocalTrackId[] = "local_track_id"; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 470 |
473 private: | 471 private: |
474 double time_now_; | 472 double time_now_; |
475 }; | 473 }; |
476 | 474 |
477 class StatsCollectorTest : public testing::Test { | 475 class StatsCollectorTest : public testing::Test { |
478 protected: | 476 protected: |
479 StatsCollectorTest() | 477 StatsCollectorTest() |
480 : media_engine_(new cricket::FakeMediaEngine()), | 478 : media_engine_(new cricket::FakeMediaEngine()), |
481 channel_manager_( | 479 channel_manager_( |
482 new cricket::ChannelManager(media_engine_, | 480 new cricket::ChannelManager(media_engine_, rtc::Thread::Current())), |
483 new cricket::FakeDeviceManager(), | |
484 rtc::Thread::Current())), | |
485 session_(channel_manager_.get()), | 481 session_(channel_manager_.get()), |
486 signaling_(channel_manager_.get()) { | 482 signaling_(channel_manager_.get()) { |
487 // By default, we ignore session GetStats calls. | 483 // By default, we ignore session GetStats calls. |
488 EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false)); | 484 EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false)); |
489 EXPECT_CALL(session_, mediastream_signaling()).WillRepeatedly( | 485 EXPECT_CALL(session_, mediastream_signaling()).WillRepeatedly( |
490 Return(&signaling_)); | 486 Return(&signaling_)); |
491 } | 487 } |
492 | 488 |
493 ~StatsCollectorTest() {} | 489 ~StatsCollectorTest() {} |
494 | 490 |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 cricket::VoiceSenderInfo new_voice_sender_info; | 1699 cricket::VoiceSenderInfo new_voice_sender_info; |
1704 InitVoiceSenderInfo(&new_voice_sender_info); | 1700 InitVoiceSenderInfo(&new_voice_sender_info); |
1705 cricket::VoiceMediaInfo new_stats_read; | 1701 cricket::VoiceMediaInfo new_stats_read; |
1706 reports.clear(); | 1702 reports.clear(); |
1707 SetupAndVerifyAudioTrackStats( | 1703 SetupAndVerifyAudioTrackStats( |
1708 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, | 1704 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, |
1709 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); | 1705 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); |
1710 } | 1706 } |
1711 | 1707 |
1712 } // namespace webrtc | 1708 } // namespace webrtc |
OLD | NEW |