| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "content/child/child_process.h" | 7 #include "content/child/child_process.h" |
| 8 #include "content/renderer/media/media_recorder_handler.h" | 8 #include "content/renderer/media/media_recorder_handler.h" |
| 9 #include "content/renderer/media/mock_media_stream_registry.h" | 9 #include "content/renderer/media/mock_media_stream_registry.h" |
| 10 #include "media/audio/simple_sources.h" | 10 #include "media/audio/simple_sources.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (GetParam().has_video) | 103 if (GetParam().has_video) |
| 104 registry_.AddVideoTrack(kTestVideoTrackId); | 104 registry_.AddVideoTrack(kTestVideoTrackId); |
| 105 if (GetParam().has_audio) | 105 if (GetParam().has_audio) |
| 106 registry_.AddAudioTrack(kTestAudioTrackId); | 106 registry_.AddAudioTrack(kTestAudioTrackId); |
| 107 } | 107 } |
| 108 | 108 |
| 109 scoped_ptr<media::AudioBus> NextAudioBus() { | 109 scoped_ptr<media::AudioBus> NextAudioBus() { |
| 110 scoped_ptr<media::AudioBus> bus(media::AudioBus::Create( | 110 scoped_ptr<media::AudioBus> bus(media::AudioBus::Create( |
| 111 kTestAudioChannels, | 111 kTestAudioChannels, |
| 112 kTestAudioSampleRate * kTestAudioBufferDurationMS / 1000)); | 112 kTestAudioSampleRate * kTestAudioBufferDurationMS / 1000)); |
| 113 audio_source_.OnMoreData(bus.get(), 0); | 113 audio_source_.OnMoreData(bus.get(), 0, 0); |
| 114 return bus.Pass(); | 114 return bus.Pass(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks | 117 // A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks |
| 118 // and Sources in |registry_| into believing they are on the right threads. | 118 // and Sources in |registry_| into believing they are on the right threads. |
| 119 const base::MessageLoopForUI message_loop_; | 119 const base::MessageLoopForUI message_loop_; |
| 120 const ChildProcess child_process_; | 120 const ChildProcess child_process_; |
| 121 MockMediaStreamRegistry registry_; | 121 MockMediaStreamRegistry registry_; |
| 122 | 122 |
| 123 // The Class under test. Needs to be scoped_ptr to force its destruction. | 123 // The Class under test. Needs to be scoped_ptr to force its destruction. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 298 } |
| 299 | 299 |
| 300 media_recorder_handler_->stop(); | 300 media_recorder_handler_->stop(); |
| 301 | 301 |
| 302 // Expect a last call on destruction, with size 0 and |lastInSlice| true. | 302 // Expect a last call on destruction, with size 0 and |lastInSlice| true. |
| 303 EXPECT_CALL(*this, writeData(nullptr, 0, true)).Times(1); | 303 EXPECT_CALL(*this, writeData(nullptr, 0, true)).Times(1); |
| 304 media_recorder_handler_.reset(); | 304 media_recorder_handler_.reset(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace content | 307 } // namespace content |
| OLD | NEW |