OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 29 matching lines...) Expand all Loading... |
40 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
41 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
42 #include "webrtc/base/gunit.h" | 42 #include "webrtc/base/gunit.h" |
43 | 43 |
44 using ::testing::_; | 44 using ::testing::_; |
45 using ::testing::Exactly; | 45 using ::testing::Exactly; |
46 | 46 |
47 static const char kStreamLabel1[] = "local_stream_1"; | 47 static const char kStreamLabel1[] = "local_stream_1"; |
48 static const char kVideoTrackId[] = "video_1"; | 48 static const char kVideoTrackId[] = "video_1"; |
49 static const char kAudioTrackId[] = "audio_1"; | 49 static const char kAudioTrackId[] = "audio_1"; |
50 static const uint32 kVideoSsrc = 98; | 50 static const uint32_t kVideoSsrc = 98; |
51 static const uint32 kAudioSsrc = 99; | 51 static const uint32_t kAudioSsrc = 99; |
52 | 52 |
53 namespace webrtc { | 53 namespace webrtc { |
54 | 54 |
55 // Helper class to test MediaStreamHandler. | 55 // Helper class to test MediaStreamHandler. |
56 class MockAudioProvider : public AudioProviderInterface { | 56 class MockAudioProvider : public AudioProviderInterface { |
57 public: | 57 public: |
58 virtual ~MockAudioProvider() {} | 58 virtual ~MockAudioProvider() {} |
59 MOCK_METHOD3(SetAudioPlayout, void(uint32 ssrc, bool enable, | 59 MOCK_METHOD3(SetAudioPlayout, |
60 cricket::AudioRenderer* renderer)); | 60 void(uint32_t ssrc, |
61 MOCK_METHOD4(SetAudioSend, void(uint32 ssrc, bool enable, | 61 bool enable, |
62 const cricket::AudioOptions& options, | 62 cricket::AudioRenderer* renderer)); |
63 cricket::AudioRenderer* renderer)); | 63 MOCK_METHOD4(SetAudioSend, |
64 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32 ssrc, double volume)); | 64 void(uint32_t ssrc, |
| 65 bool enable, |
| 66 const cricket::AudioOptions& options, |
| 67 cricket::AudioRenderer* renderer)); |
| 68 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume)); |
65 }; | 69 }; |
66 | 70 |
67 // Helper class to test MediaStreamHandler. | 71 // Helper class to test MediaStreamHandler. |
68 class MockVideoProvider : public VideoProviderInterface { | 72 class MockVideoProvider : public VideoProviderInterface { |
69 public: | 73 public: |
70 virtual ~MockVideoProvider() {} | 74 virtual ~MockVideoProvider() {} |
71 MOCK_METHOD2(SetCaptureDevice, bool(uint32 ssrc, | 75 MOCK_METHOD2(SetCaptureDevice, |
72 cricket::VideoCapturer* camera)); | 76 bool(uint32_t ssrc, cricket::VideoCapturer* camera)); |
73 MOCK_METHOD3(SetVideoPlayout, void(uint32 ssrc, | 77 MOCK_METHOD3(SetVideoPlayout, |
74 bool enable, | 78 void(uint32_t ssrc, |
75 cricket::VideoRenderer* renderer)); | 79 bool enable, |
76 MOCK_METHOD3(SetVideoSend, void(uint32 ssrc, bool enable, | 80 cricket::VideoRenderer* renderer)); |
77 const cricket::VideoOptions* options)); | 81 MOCK_METHOD3(SetVideoSend, |
| 82 void(uint32_t ssrc, |
| 83 bool enable, |
| 84 const cricket::VideoOptions* options)); |
78 }; | 85 }; |
79 | 86 |
80 class FakeVideoSource : public Notifier<VideoSourceInterface> { | 87 class FakeVideoSource : public Notifier<VideoSourceInterface> { |
81 public: | 88 public: |
82 static rtc::scoped_refptr<FakeVideoSource> Create() { | 89 static rtc::scoped_refptr<FakeVideoSource> Create() { |
83 return new rtc::RefCountedObject<FakeVideoSource>(); | 90 return new rtc::RefCountedObject<FakeVideoSource>(); |
84 } | 91 } |
85 virtual cricket::VideoCapturer* GetVideoCapturer() { | 92 virtual cricket::VideoCapturer* GetVideoCapturer() { |
86 return &fake_capturer_; | 93 return &fake_capturer_; |
87 } | 94 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 323 |
317 double new_volume = 0.8; | 324 double new_volume = 0.8; |
318 EXPECT_CALL(audio_provider_, SetAudioPlayoutVolume(kAudioSsrc, new_volume)); | 325 EXPECT_CALL(audio_provider_, SetAudioPlayoutVolume(kAudioSsrc, new_volume)); |
319 audio_track_->GetSource()->SetVolume(new_volume); | 326 audio_track_->GetSource()->SetVolume(new_volume); |
320 | 327 |
321 RemoveRemoteAudioTrack(); | 328 RemoveRemoteAudioTrack(); |
322 handlers_.TearDown(); | 329 handlers_.TearDown(); |
323 } | 330 } |
324 | 331 |
325 } // namespace webrtc | 332 } // namespace webrtc |
OLD | NEW |