| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 private: | 49 private: |
| 50 NotifierInterface* notifier_; | 50 NotifierInterface* notifier_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class MediaStreamTest: public testing::Test { | 53 class MediaStreamTest: public testing::Test { |
| 54 protected: | 54 protected: |
| 55 virtual void SetUp() { | 55 virtual void SetUp() { |
| 56 stream_ = MediaStream::Create(kStreamLabel1); | 56 stream_ = MediaStream::Create(kStreamLabel1); |
| 57 ASSERT_TRUE(stream_.get() != NULL); | 57 ASSERT_TRUE(stream_.get() != NULL); |
| 58 | 58 |
| 59 video_track_ = VideoTrack::Create( | 59 video_track_ = |
| 60 kVideoTrackId, FakeVideoTrackSource::Create(), rtc::Thread::Current()); | 60 VideoTrack::Create(kVideoTrackId, FakeVideoTrackSource::Create()); |
| 61 ASSERT_TRUE(video_track_.get() != NULL); | 61 ASSERT_TRUE(video_track_.get() != NULL); |
| 62 EXPECT_EQ(MediaStreamTrackInterface::kLive, video_track_->state()); | 62 EXPECT_EQ(MediaStreamTrackInterface::kLive, video_track_->state()); |
| 63 | 63 |
| 64 audio_track_ = AudioTrack::Create(kAudioTrackId, NULL); | 64 audio_track_ = AudioTrack::Create(kAudioTrackId, NULL); |
| 65 | 65 |
| 66 ASSERT_TRUE(audio_track_.get() != NULL); | 66 ASSERT_TRUE(audio_track_.get() != NULL); |
| 67 EXPECT_EQ(MediaStreamTrackInterface::kLive, audio_track_->state()); | 67 EXPECT_EQ(MediaStreamTrackInterface::kLive, audio_track_->state()); |
| 68 | 68 |
| 69 EXPECT_TRUE(stream_->AddTrack(video_track_)); | 69 EXPECT_TRUE(stream_->AddTrack(video_track_)); |
| 70 EXPECT_FALSE(stream_->AddTrack(video_track_)); | 70 EXPECT_FALSE(stream_->AddTrack(video_track_)); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 ChangeTrack(video_track.get()); | 145 ChangeTrack(video_track.get()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 TEST_F(MediaStreamTest, ChangeAudioTrack) { | 148 TEST_F(MediaStreamTest, ChangeAudioTrack) { |
| 149 scoped_refptr<webrtc::AudioTrackInterface> audio_track( | 149 scoped_refptr<webrtc::AudioTrackInterface> audio_track( |
| 150 stream_->GetAudioTracks()[0]); | 150 stream_->GetAudioTracks()[0]); |
| 151 ChangeTrack(audio_track.get()); | 151 ChangeTrack(audio_track.get()); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace webrtc | 154 } // namespace webrtc |
| OLD | NEW |