| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 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/WebMediaStreamTrack.h" | 39 #include "public/platform/WebMediaStreamTrack.h" |
| 40 #include "public/platform/WebMediaStreamTrackSourcesRequest.h" |
| 40 #include "public/platform/WebSourceInfo.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 bool MockWebMediaStreamCenter::getSourceInfos(const WebString& url, WebVector<We
bSourceInfo>& webSourceInfoVector) | 52 bool MockWebMediaStreamCenter::getMediaStreamTrackSources(const WebMediaStreamTr
ackSourcesRequest& request) |
| 52 { | 53 { |
| 53 size_t size = 2; | 54 size_t size = 2; |
| 54 WebVector<WebSourceInfo> results(size); | 55 WebVector<WebSourceInfo> results(size); |
| 55 results[0].initialize("MockAudioDevice#1", WebSourceInfo::SourceKindAudio, "
Mock audio device", WebSourceInfo::VideoFacingModeNone); | 56 results[0].initialize("MockAudioDevice#1", WebSourceInfo::SourceKindAudio, "
Mock audio device", WebSourceInfo::VideoFacingModeNone); |
| 56 results[1].initialize("MockVideoDevice#1", WebSourceInfo::SourceKindVideo, "
Mock video device", WebSourceInfo::VideoFacingModeEnvironment); | 57 results[1].initialize("MockVideoDevice#1", WebSourceInfo::SourceKindVideo, "
Mock video device", WebSourceInfo::VideoFacingModeEnvironment); |
| 57 webSourceInfoVector.swap(results); | 58 request.requestSucceeded(results); |
| 58 return true; | 59 return true; |
| 59 } | 60 } |
| 60 | 61 |
| 61 void MockWebMediaStreamCenter::didEnableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) | 62 void MockWebMediaStreamCenter::didEnableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) |
| 62 { | 63 { |
| 63 component.source().setReadyState(WebMediaStreamSource::ReadyStateLive); | 64 component.source().setReadyState(WebMediaStreamSource::ReadyStateLive); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void MockWebMediaStreamCenter::didDisableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) | 67 void MockWebMediaStreamCenter::didDisableMediaStreamTrack(const WebMediaStream&,
const WebMediaStreamTrack& component) |
| 67 { | 68 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 98 if (source.requiresAudioConsumer()) { | 99 if (source.requiresAudioConsumer()) { |
| 99 MockWebAudioDestinationConsumer* consumer = new MockWebAudioDestinat
ionConsumer(); | 100 MockWebAudioDestinationConsumer* consumer = new MockWebAudioDestinat
ionConsumer(); |
| 100 source.addAudioConsumer(consumer); | 101 source.addAudioConsumer(consumer); |
| 101 source.removeAudioConsumer(consumer); | 102 source.removeAudioConsumer(consumer); |
| 102 delete consumer; | 103 delete consumer; |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 } | 106 } |
| 106 | 107 |
| 107 } | 108 } |
| OLD | NEW |