| 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 a test patter (moving balls) and | 6 // playback as video. The page generates a test patter (moving balls) and |
| 7 // the rendering output of the tab is captured into a LocalMediaStream. Then, | 7 // the rendering output of the tab is captured into a LocalMediaStream. Then, |
| 8 // the LocalMediaStream is plugged into a video element for playback. | 8 // the LocalMediaStream is plugged into a video element for playback. |
| 9 // | 9 // |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Kick it off. | 65 // Kick it off. |
| 66 draw(); | 66 draw(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Set up a WebRTC connection and pipe |stream| through it. | 69 // Set up a WebRTC connection and pipe |stream| through it. |
| 70 function testThroughWebRTC(stream) { | 70 function testThroughWebRTC(stream) { |
| 71 capture_stream = stream; | 71 capture_stream = stream; |
| 72 console.log("Testing through webrtc."); | 72 console.log("Testing through webrtc."); |
| 73 var sender = new webkitRTCPeerConnection(null); | 73 var sender = new RTCPeerConnection(); |
| 74 var receiver = new webkitRTCPeerConnection(null); | 74 var receiver = new RTCPeerConnection(); |
| 75 sender.onicecandidate = function (event) { | 75 sender.onicecandidate = function (event) { |
| 76 if (event.candidate) { | 76 if (event.candidate) { |
| 77 receiver.addIceCandidate(new RTCIceCandidate(event.candidate)); | 77 receiver.addIceCandidate(new RTCIceCandidate(event.candidate)); |
| 78 } | 78 } |
| 79 }; | 79 }; |
| 80 receiver.onicecandidate = function (event) { | 80 receiver.onicecandidate = function (event) { |
| 81 if (event.candidate) { | 81 if (event.candidate) { |
| 82 sender.addIceCandidate(new RTCIceCandidate(event.candidate)); | 82 sender.addIceCandidate(new RTCIceCandidate(event.candidate)); |
| 83 } | 83 } |
| 84 }; | 84 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 }, | 118 }, |
| 119 f); | 119 f); |
| 120 } | 120 } |
| 121 | 121 |
| 122 chrome.test.runTests([ tabCapturePerformanceTest ]); | 122 chrome.test.runTests([ tabCapturePerformanceTest ]); |
| 123 | 123 |
| 124 // TODO(hubbe): Consider capturing audio as well, need to figure out how to | 124 // TODO(hubbe): Consider capturing audio as well, need to figure out how to |
| 125 // capture relevant statistics for that though. | 125 // capture relevant statistics for that though. |
| OLD | NEW |