| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/mock_web_user_media_client.h" | 5 #include "components/test_runner/mock_web_user_media_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (!constraints.isNull() && | 158 if (!constraints.isNull() && |
| 159 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) { | 159 !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) { |
| 160 delegate_->PostTask(new UserMediaRequestConstraintFailedTask( | 160 delegate_->PostTask(new UserMediaRequestConstraintFailedTask( |
| 161 this, request, failed_constraint)); | 161 this, request, failed_constraint)); |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 | 164 |
| 165 WebMediaStream stream; | 165 WebMediaStream stream; |
| 166 stream.initialize(WebVector<WebMediaStreamTrack>(), | 166 stream.initialize(WebVector<WebMediaStreamTrack>(), |
| 167 WebVector<WebMediaStreamTrack>()); | 167 WebVector<WebMediaStreamTrack>()); |
| 168 stream.setExtraData(new MockExtraData()); | 168 delegate_->AddMediaStream(&stream); |
| 169 | 169 |
| 170 if (request.audio() && | 170 if (request.audio() && |
| 171 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) { | 171 !delegate_->AddMediaStreamAudioSourceAndTrack(&stream)) { |
| 172 WebMediaStreamSource source; | 172 WebMediaStreamSource source; |
| 173 source.initialize("MockAudioDevice#1", | 173 source.initialize("MockAudioDevice#1", |
| 174 WebMediaStreamSource::TypeAudio, | 174 WebMediaStreamSource::TypeAudio, |
| 175 "Mock audio device", | 175 "Mock audio device", |
| 176 false /* remote */, | 176 false /* remote */, |
| 177 true /* readonly */); | 177 true /* readonly */); |
| 178 WebMediaStreamTrack web_track; | 178 WebMediaStreamTrack web_track; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 sources[i].initialize(WebString::fromUTF8(test_sources[i].id), | 269 sources[i].initialize(WebString::fromUTF8(test_sources[i].id), |
| 270 test_sources[i].kind, | 270 test_sources[i].kind, |
| 271 WebString::fromUTF8(test_sources[i].label), | 271 WebString::fromUTF8(test_sources[i].label), |
| 272 test_sources[i].facing); | 272 test_sources[i].facing); |
| 273 } | 273 } |
| 274 | 274 |
| 275 delegate_->PostTask(new SourcesRequestTask(this, request, sources)); | 275 delegate_->PostTask(new SourcesRequestTask(this, request, sources)); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace test_runner | 278 } // namespace test_runner |
| OLD | NEW |