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
3 // found in the LICENSE file.
5 window
.addEventListener('load', function() {
6 document
.body
.onclick
= function toggleBodyFullscreen() {
7 if (document
.fullscreenElement
|| document
.webkitFullscreenElement
) {
8 if (document
.exitFullscreen
)
9 document
.exitFullscreen();
10 else if (document
.webkitExitFullscreen
)
11 document
.webkitExitFullscreen();
13 chrome
.test
.assertTrue(!"HTML5 Fullscreen API missing");
15 if (document
.body
.requestFullscreen
)
16 document
.body
.requestFullscreen();
17 else if (document
.body
.webkitRequestFullscreen
)
18 document
.body
.webkitRequestFullscreen();
20 chrome
.test
.assertTrue(!"HTML5 Fullscreen API missing");
25 var mediaStream
= null;
28 chrome
.tabCapture
.onStatusChanged
.addListener(function(info
) {
29 if (info
.status
== 'active') {
30 events
.push(info
.fullscreen
);
31 if (events
.length
== 3) {
32 chrome
.test
.assertFalse(events
[0]);
33 chrome
.test
.assertTrue(events
[1]);
34 chrome
.test
.assertFalse(events
[2]);
35 mediaStream
.getVideoTracks()[0].stop();
36 mediaStream
.getAudioTracks()[0].stop();
37 chrome
.test
.succeed();
41 chrome
.test
.sendMessage('entered_fullscreen');
45 chrome
.tabCapture
.capture({audio
: true, video
: true}, function(stream
) {
46 chrome
.test
.assertTrue(!!stream
);
48 chrome
.test
.notifyPass();
49 chrome
.test
.sendMessage('tab_capture_started');