| 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 // The tests here cover the end-to-end functionality of tab capturing and | 5 // The tests here cover the end-to-end functionality of tab capturing and |
| 6 // playback as video. The page generates video test patterns that rotate | 6 // playback as video. The page generates video test patterns that rotate |
| 7 // cyclicly, and the rendering output of the tab is captured into a | 7 // cyclicly, and the rendering output of the tab is captured into a |
| 8 // local MediaStream. This stream is then piped into a video element for | 8 // local MediaStream. This stream is then piped into a video element for |
| 9 // playback, and a canvas is used to examine the frames of the video for | 9 // playback, and a canvas is used to examine the frames of the video for |
| 10 // expected content. The stream may be plumbed one of two ways, depending on | 10 // expected content. The stream may be plumbed one of two ways, depending on |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 maxFrameRate: frameRate, | 200 maxFrameRate: frameRate, |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 }, | 203 }, |
| 204 function remoteTheStream(captureStream) { | 204 function remoteTheStream(captureStream) { |
| 205 chrome.test.assertTrue(!!captureStream); | 205 chrome.test.assertTrue(!!captureStream); |
| 206 if (transportMethod == 'local') { | 206 if (transportMethod == 'local') { |
| 207 receiveStream = captureStream; | 207 receiveStream = captureStream; |
| 208 waitForExpectedColors(colorDeviation); | 208 waitForExpectedColors(colorDeviation); |
| 209 } else if (transportMethod == 'webrtc') { | 209 } else if (transportMethod == 'webrtc') { |
| 210 var sender = new webkitRTCPeerConnection(null); | 210 var sender = new RTCPeerConnection(); |
| 211 var receiver = new webkitRTCPeerConnection(null); | 211 var receiver = new RTCPeerConnection(); |
| 212 sender.onicecandidate = function (event) { | 212 sender.onicecandidate = function (event) { |
| 213 if (event.candidate) { | 213 if (event.candidate) { |
| 214 receiver.addIceCandidate(new RTCIceCandidate(event.candidate)); | 214 receiver.addIceCandidate(new RTCIceCandidate(event.candidate)); |
| 215 } | 215 } |
| 216 }; | 216 }; |
| 217 receiver.onicecandidate = function (event) { | 217 receiver.onicecandidate = function (event) { |
| 218 if (event.candidate) { | 218 if (event.candidate) { |
| 219 sender.addIceCandidate(new RTCIceCandidate(event.candidate)); | 219 sender.addIceCandidate(new RTCIceCandidate(event.candidate)); |
| 220 } | 220 } |
| 221 }; | 221 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 237 } else { | 237 } else { |
| 238 chrome.test.fail("Unknown transport method: " + transportMethod); | 238 chrome.test.fail("Unknown transport method: " + transportMethod); |
| 239 } | 239 } |
| 240 }); | 240 }); |
| 241 } | 241 } |
| 242 ]); | 242 ]); |
| 243 | 243 |
| 244 // TODO(miu): Once the WebAudio API is finalized, we should add a test to emit a | 244 // TODO(miu): Once the WebAudio API is finalized, we should add a test to emit a |
| 245 // tone from the sender page, and have the receiver page check for the audio | 245 // tone from the sender page, and have the receiver page check for the audio |
| 246 // tone. | 246 // tone. |
| OLD | NEW |