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 window.addEventListener('load', function() { | 5 window.addEventListener('load', function() { |
6 document.body.onclick = function toggleBodyFullscreen() { | 6 document.body.onclick = function toggleBodyFullscreen() { |
7 if (document.fullscreenElement || document.webkitFullscreenElement) { | 7 if (document.fullscreenElement || document.webkitFullscreenElement) { |
8 if (document.exitFullscreen) | 8 if (document.exitFullscreen) |
9 document.exitFullscreen(); | 9 document.exitFullscreen(); |
10 else if (document.webkitExitFullscreen) | 10 else if (document.webkitExitFullscreen) |
(...skipping 14 matching lines...) Expand all Loading... |
25 var mediaStream = null; | 25 var mediaStream = null; |
26 var events = []; | 26 var events = []; |
27 | 27 |
28 chrome.tabCapture.onStatusChanged.addListener(function(info) { | 28 chrome.tabCapture.onStatusChanged.addListener(function(info) { |
29 if (info.status == 'active') { | 29 if (info.status == 'active') { |
30 events.push(info.fullscreen); | 30 events.push(info.fullscreen); |
31 if (events.length == 3) { | 31 if (events.length == 3) { |
32 chrome.test.assertFalse(events[0]); | 32 chrome.test.assertFalse(events[0]); |
33 chrome.test.assertTrue(events[1]); | 33 chrome.test.assertTrue(events[1]); |
34 chrome.test.assertFalse(events[2]); | 34 chrome.test.assertFalse(events[2]); |
35 mediaStream.stop(); | 35 mediaStream.getVideoTracks()[0].stop(); |
| 36 mediaStream.getAudioTracks()[0].stop(); |
36 chrome.test.succeed(); | 37 chrome.test.succeed(); |
37 } | 38 } |
38 | 39 |
39 if (info.fullscreen) | 40 if (info.fullscreen) |
40 chrome.test.sendMessage('entered_fullscreen'); | 41 chrome.test.sendMessage('entered_fullscreen'); |
41 } | 42 } |
42 }); | 43 }); |
43 | 44 |
44 chrome.tabCapture.capture({audio: true, video: true}, function(stream) { | 45 chrome.tabCapture.capture({audio: true, video: true}, function(stream) { |
45 chrome.test.assertTrue(!!stream); | 46 chrome.test.assertTrue(!!stream); |
46 mediaStream = stream; | 47 mediaStream = stream; |
47 chrome.test.notifyPass(); | 48 chrome.test.notifyPass(); |
48 chrome.test.sendMessage('tab_capture_started'); | 49 chrome.test.sendMessage('tab_capture_started'); |
49 }); | 50 }); |
OLD | NEW |