Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: chrome/test/data/extensions/api_test/tab_capture/fullscreen_test.js

Issue 736793004: Repair/Enable TabCaptureApiTest.FullscreenEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/tab_capture/fullscreen_test.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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() {
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();
12 else
13 chrome.test.assertTrue(!"HTML5 Fullscreen API missing");
14 } else {
15 if (document.body.requestFullscreen)
16 document.body.requestFullscreen();
17 else if (document.body.webkitRequestFullscreen)
18 document.body.webkitRequestFullscreen();
19 else
20 chrome.test.assertTrue(!"HTML5 Fullscreen API missing");
21 }
22 };
23 });
24
5 var mediaStream = null; 25 var mediaStream = null;
6 var events = []; 26 var events = [];
7 27
8 chrome.tabCapture.onStatusChanged.addListener(function(info) { 28 chrome.tabCapture.onStatusChanged.addListener(function(info) {
9 if (info.status == 'active') { 29 if (info.status == 'active') {
10 events.push(info.fullscreen); 30 events.push(info.fullscreen);
11 if (events.length == 3) { 31 if (events.length == 3) {
12 chrome.test.assertFalse(events[0]); 32 chrome.test.assertFalse(events[0]);
13 chrome.test.assertTrue(events[1]); 33 chrome.test.assertTrue(events[1]);
14 chrome.test.assertFalse(events[2]); 34 chrome.test.assertFalse(events[2]);
15 mediaStream.stop(); 35 mediaStream.stop();
16 chrome.test.succeed(); 36 chrome.test.succeed();
17 } 37 }
38
39 if (info.fullscreen)
40 chrome.test.sendMessage('entered_fullscreen', function() {});
18 } 41 }
19 }); 42 });
20 43
21 chrome.tabCapture.capture({audio: true, video: true}, function(stream) { 44 chrome.tabCapture.capture({audio: true, video: true}, function(stream) {
22 chrome.test.assertTrue(!!stream); 45 chrome.test.assertTrue(!!stream);
23 mediaStream = stream; 46 mediaStream = stream;
24
25 chrome.test.notifyPass(); 47 chrome.test.notifyPass();
26 chrome.test.sendMessage('ready1', function() { 48 chrome.test.sendMessage('tab_capture_started', function() {});
27 chrome.test.sendMessage('ready2', function() {});
28 });
29 }); 49 });
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/tab_capture/fullscreen_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698