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

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

Issue 734853003: Misc clean-up of TabCaptureApiTests; and re-enable more tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 var tabCapture = chrome.tabCapture; 5 var tabCapture = chrome.tabCapture;
6 6
7 chrome.test.runTests([ 7 chrome.test.runTests([
8 function captureTabAndVerifyStateTransitions() { 8 function captureTabAndVerifyStateTransitions() {
9 // Tab capture events in the order they happen. 9 // Tab capture events in the order they happen.
10 var tabCaptureEvents = []; 10 var tabCaptureEvents = [];
(...skipping 27 matching lines...) Expand all
38 if (infos[i].tabId == secondTab) { 38 if (infos[i].tabId == secondTab) {
39 chrome.test.assertNe(null, status); 39 chrome.test.assertNe(null, status);
40 chrome.test.assertEq(status, infos[i].status); 40 chrome.test.assertEq(status, infos[i].status);
41 chrome.test.assertEq(false, infos[i].fullscreen); 41 chrome.test.assertEq(false, infos[i].fullscreen);
42 return; 42 return;
43 } 43 }
44 } 44 }
45 } 45 }
46 46
47 // Step 4: After the second tab is closed, check that getCapturedTabs() 47 // Step 4: After the second tab is closed, check that getCapturedTabs()
48 // returns no info at all about the second tab. http://crbug.com/338445 48 // returns no info at all about the second tab.
49 chrome.tabs.onRemoved.addListener(function() { 49 chrome.tabs.onRemoved.addListener(function() {
50 tabCapture.getCapturedTabs(function checkNoInfos(infos) { 50 tabCapture.getCapturedTabs(function checkNoInfos(infos) {
51 checkInfoForSecondTabHasStatus(infos, null); 51 checkInfoForSecondTabHasStatus(infos, null);
52 chrome.test.succeed(); 52 chrome.test.succeed();
53 }); 53 });
54 }); 54 });
55 55
56 var activeStream = null; 56 var activeStream = null;
57 57
58 // Step 3: After the stream is stopped, check that getCapturedTabs() 58 // Step 3: After the stream is stopped, check that getCapturedTabs()
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 }, 98 },
99 99
100 function onlyVideo() { 100 function onlyVideo() {
101 tabCapture.capture({video: true}, function(stream) { 101 tabCapture.capture({video: true}, function(stream) {
102 chrome.test.assertTrue(!!stream); 102 chrome.test.assertTrue(!!stream);
103 stream.stop(); 103 stream.stop();
104 chrome.test.succeed(); 104 chrome.test.succeed();
105 }); 105 });
106 }, 106 },
107 107
108 function onlyAudio() {
109 tabCapture.capture({audio: true}, function(stream) {
110 chrome.test.assertTrue(!!stream);
111 stream.stop();
112 chrome.test.succeed();
113 });
114 },
115
108 function noAudioOrVideoRequested() { 116 function noAudioOrVideoRequested() {
109 // If not specified, video is not requested. 117 // If not specified, video is not requested.
110 tabCapture.capture({audio: false}, function(stream) { 118 tabCapture.capture({audio: false}, function(stream) {
111 chrome.test.assertTrue(!stream); 119 chrome.test.assertTrue(!stream);
112 chrome.test.succeed(); 120 chrome.test.succeed();
113 }); 121 });
114 } 122 }
115
116 ]); 123 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698