| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "MockWebMediaStreamCenter.h" | 33 #include "MockWebMediaStreamCenter.h" |
| 34 | 34 |
| 35 #include "public/platform/WebAudioDestinationConsumer.h" | 35 #include "public/platform/WebAudioDestinationConsumer.h" |
| 36 #include "public/platform/WebMediaStream.h" | 36 #include "public/platform/WebMediaStream.h" |
| 37 #include "public/platform/WebMediaStreamCenterClient.h" | 37 #include "public/platform/WebMediaStreamCenterClient.h" |
| 38 #include "public/platform/WebMediaStreamSource.h" | 38 #include "public/platform/WebMediaStreamSource.h" |
| 39 #include "public/platform/WebMediaStreamSourcesRequest.h" | 39 #include "public/platform/WebMediaStreamSourcesRequest.h" |
| 40 #include "public/platform/WebMediaStreamTrack.h" | 40 #include "public/platform/WebMediaStreamTrack.h" |
| 41 #include "public/platform/WebSourceInfo.h" |
| 41 #include "public/platform/WebVector.h" | 42 #include "public/platform/WebVector.h" |
| 42 | 43 |
| 43 using namespace WebKit; | 44 using namespace WebKit; |
| 44 | 45 |
| 45 namespace WebTestRunner { | 46 namespace WebTestRunner { |
| 46 | 47 |
| 47 MockWebMediaStreamCenter::MockWebMediaStreamCenter(WebMediaStreamCenterClient* c
lient) | 48 MockWebMediaStreamCenter::MockWebMediaStreamCenter(WebMediaStreamCenterClient* c
lient) |
| 48 { | 49 { |
| 49 } | 50 } |
| 50 | 51 |
| 51 void MockWebMediaStreamCenter::queryMediaStreamSources(const WebMediaStreamSourc
esRequest& request) | 52 void MockWebMediaStreamCenter::queryMediaStreamSources(const WebMediaStreamSourc
esRequest& request) |
| 52 { | 53 { |
| 53 WebVector<WebMediaStreamSource> audioSources, videoSources; | 54 WebVector<WebMediaStreamSource> audioSources, videoSources; |
| 54 request.didCompleteQuery(audioSources, videoSources); | 55 request.didCompleteQuery(audioSources, videoSources); |
| 55 } | 56 } |
| 56 | 57 |
| 58 bool MockWebMediaStreamCenter::getSourceInfos(const WebString& url, WebVector<We
bSourceInfo>& webSourceInfoVector) |
| 59 { |
| 60 size_t size = 2; |
| 61 WebVector<WebSourceInfo> results(size); |
| 62 results[0].initialize("MockAudioDevice#1", WebSourceInfo::SourceKindAudio, "
Mock audio device", WebSourceInfo::VideoFacingModeNone); |
| 63 results[1].initialize("MockVideoDevice#1", WebSourceInfo::SourceKindVideo, "
Mock video device", WebSourceInfo::VideoFacingModeEnvironment); |
| 64 webSourceInfoVector.swap(results); |
| 65 return true; |
| 66 } |
| 67 |
| 57 void MockWebMediaStreamCenter::didEnableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) | 68 void MockWebMediaStreamCenter::didEnableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) |
| 58 { | 69 { |
| 59 component.source().setReadyState(WebMediaStreamSource::ReadyStateLive); | 70 component.source().setReadyState(WebMediaStreamSource::ReadyStateLive); |
| 60 } | 71 } |
| 61 | 72 |
| 62 void MockWebMediaStreamCenter::didDisableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) | 73 void MockWebMediaStreamCenter::didDisableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) |
| 63 { | 74 { |
| 64 component.source().setReadyState(WebMediaStreamSource::ReadyStateMuted); | 75 component.source().setReadyState(WebMediaStreamSource::ReadyStateMuted); |
| 65 } | 76 } |
| 66 | 77 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 94 if (source.requiresAudioConsumer()) { | 105 if (source.requiresAudioConsumer()) { |
| 95 MockWebAudioDestinationConsumer* consumer = new MockWebAudioDestinat
ionConsumer(); | 106 MockWebAudioDestinationConsumer* consumer = new MockWebAudioDestinat
ionConsumer(); |
| 96 source.addAudioConsumer(consumer); | 107 source.addAudioConsumer(consumer); |
| 97 source.removeAudioConsumer(consumer); | 108 source.removeAudioConsumer(consumer); |
| 98 delete consumer; | 109 delete consumer; |
| 99 } | 110 } |
| 100 } | 111 } |
| 101 } | 112 } |
| 102 | 113 |
| 103 } | 114 } |
| OLD | NEW |