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 signal (a full color fill), and | 6 // playback as video. The page generates a test signal (a full color fill), 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, and a | 8 // the LocalMediaStream is plugged into a video element for playback, and a |
9 // canvas is used to examine the frames of the video for expected content. | 9 // canvas is used to examine the frames of the video for expected content. |
10 // | 10 // |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 ++curColorIdx; | 78 ++curColorIdx; |
79 updateTestDocument(); | 79 updateTestDocument(); |
80 } else { | 80 } else { |
81 video.removeEventListener("timeupdate", checkVideoForFillColor); | 81 video.removeEventListener("timeupdate", checkVideoForFillColor); |
82 stream.stop(); | 82 stream.stop(); |
83 chrome.test.succeed(); | 83 chrome.test.succeed(); |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
87 // Play the LocalMediaStream in the video element. | 87 // Play the LocalMediaStream in the video element. |
88 video.src = webkitURL.createObjectURL(stream); | 88 video.src = URL.createObjectURL(stream); |
89 video.play(); | 89 video.play(); |
90 | 90 |
91 // Kick it off. | 91 // Kick it off. |
92 updateTestDocument(); | 92 updateTestDocument(); |
93 video.addEventListener("timeupdate", checkVideoForFillColor); | 93 video.addEventListener("timeupdate", checkVideoForFillColor); |
94 } | 94 } |
95 | 95 |
96 // Set up a WebRTC connection and pipe |stream| through it. | 96 // Set up a WebRTC connection and pipe |stream| through it. |
97 // Call TestStream with the new stream when done. | 97 // Call TestStream with the new stream when done. |
98 function testThroughWebRTC(stream) { | 98 function testThroughWebRTC(stream) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 151 } |
152 | 152 |
153 chrome.test.runTests([ | 153 chrome.test.runTests([ |
154 endToEndVideoTest, | 154 endToEndVideoTest, |
155 endToEndVideoTestWithWebRTC | 155 endToEndVideoTestWithWebRTC |
156 ]); | 156 ]); |
157 | 157 |
158 // TODO(miu): Once the WebAudio API is finalized, we should add a test to emit a | 158 // TODO(miu): Once the WebAudio API is finalized, we should add a test to emit a |
159 // tone from the sender page, and have the receiver page check for the audio | 159 // tone from the sender page, and have the receiver page check for the audio |
160 // tone. | 160 // tone. |
OLD | NEW |