OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/renderer/test_runner/WebUserMediaClientMock.h" | 5 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/shell/renderer/test_runner/MockConstraints.h" | 8 #include "content/shell/renderer/test_runner/MockConstraints.h" |
9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
10 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 10 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
11 #include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h" | 11 #include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h" |
12 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 12 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
13 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 13 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
14 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 14 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
15 #include "third_party/WebKit/public/platform/WebVector.h" | 15 #include "third_party/WebKit/public/platform/WebVector.h" |
16 #include "third_party/WebKit/public/web/WebDocument.h" | 16 #include "third_party/WebKit/public/web/WebDocument.h" |
17 #include "third_party/WebKit/public/web/WebMediaDevicesRequest.h" | 17 #include "third_party/WebKit/public/web/WebMediaDevicesRequest.h" |
18 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 18 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
19 #include "third_party/WebKit/public/web/WebUserMediaRequest.h" | 19 #include "third_party/WebKit/public/web/WebUserMediaRequest.h" |
20 | 20 |
21 using namespace blink; | 21 using namespace blink; |
22 | 22 |
23 using content::MockConstraints; | 23 namespace content { |
24 | |
25 namespace WebTestRunner { | |
26 | 24 |
27 class UserMediaRequestTask : public WebMethodTask<WebUserMediaClientMock> { | 25 class UserMediaRequestTask : public WebMethodTask<WebUserMediaClientMock> { |
28 public: | 26 public: |
29 UserMediaRequestTask(WebUserMediaClientMock* object, const WebUserMediaReque
st& request, const WebMediaStream result) | 27 UserMediaRequestTask(WebUserMediaClientMock* object, const WebUserMediaReque
st& request, const WebMediaStream result) |
30 : WebMethodTask<WebUserMediaClientMock>(object) | 28 : WebMethodTask<WebUserMediaClientMock>(object) |
31 , m_request(request) | 29 , m_request(request) |
32 , m_result(result) | 30 , m_result(result) |
33 { | 31 { |
34 DCHECK(!m_result.isNull()); | 32 DCHECK(!m_result.isNull()); |
35 } | 33 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 devices[1].initialize("device2", WebMediaDeviceInfo::MediaDeviceKindAudioOut
put, "Built-in speakers", "group1"); | 169 devices[1].initialize("device2", WebMediaDeviceInfo::MediaDeviceKindAudioOut
put, "Built-in speakers", "group1"); |
172 devices[2].initialize("device3", WebMediaDeviceInfo::MediaDeviceKindVideoInp
ut, "Build-in webcam", "group2"); | 170 devices[2].initialize("device3", WebMediaDeviceInfo::MediaDeviceKindVideoInp
ut, "Build-in webcam", "group2"); |
173 | 171 |
174 m_delegate->postTask(new MediaDevicesRequestTask(this, request, devices)); | 172 m_delegate->postTask(new MediaDevicesRequestTask(this, request, devices)); |
175 } | 173 } |
176 | 174 |
177 void WebUserMediaClientMock::cancelMediaDevicesRequest(const WebMediaDevicesRequ
est&) | 175 void WebUserMediaClientMock::cancelMediaDevicesRequest(const WebMediaDevicesRequ
est&) |
178 { | 176 { |
179 } | 177 } |
180 | 178 |
181 } | 179 } // namespace content |
OLD | NEW |