Index: chrome/test/data/extensions/api_test/tab_capture/api_tests.js |
diff --git a/chrome/test/data/extensions/api_test/tab_capture/api_tests.js b/chrome/test/data/extensions/api_test/tab_capture/api_tests.js |
index 8f3e1d168ffaf9d2717c2d1ad3448292348cdd90..b4a624b4e1db05885562def1bc36d738a671b1d4 100644 |
--- a/chrome/test/data/extensions/api_test/tab_capture/api_tests.js |
+++ b/chrome/test/data/extensions/api_test/tab_capture/api_tests.js |
@@ -5,6 +5,7 @@ |
var tabCapture = chrome.tabCapture; |
chrome.test.runTests([ |
+ |
function captureTabAndVerifyStateTransitions() { |
// Tab capture events in the order they happen. |
var tabCaptureEvents = []; |
@@ -29,7 +30,7 @@ chrome.test.runTests([ |
}, |
function getCapturedTabs() { |
- chrome.tabs.create({active:true}, function(secondTab) { |
+ chrome.tabs.create({active: true}, function(secondTab) { |
// chrome.tabCapture.capture() will only capture the active tab. |
chrome.test.assertTrue(secondTab.active); |
@@ -97,6 +98,36 @@ chrome.test.runTests([ |
}); |
}, |
+ function tabisUnmutedWhenTabCaptured() { |
miu
2015/05/26 21:28:46
nit: Capitalize the 'i' in 'is'.
Jared Sohn
2015/05/27 14:52:02
done
|
+ var stream1 = null; |
+ |
+ chrome.tabs.getCurrent(function(tab) { |
+ chrome.test.listenForever(chrome.tabs.onUpdated, |
+ function(tabId, changeInfo, updatedTab) { |
+ var expectedMutedCause = "capture"; |
+ var expectedMuted = false; |
+ |
+ if ((typeof changeInfo.mutedCause !== "undefined") && |
not at google - send to devlin
2015/05/26 23:09:46
can also use changeInfo.hasOwnProperty('mutedCause
Jared Sohn
2015/05/27 14:52:02
done
|
+ (changeInfo["mutedCause"] === expectedMutedCause) && |
miu
2015/05/26 21:28:46
nit: This line and the next should be two more spa
Jared Sohn
2015/05/27 14:52:02
done
|
+ (changeInfo["muted"] == expectedMuted)) |
not at google - send to devlin
2015/05/26 23:09:46
Also to the above: not much point using === when c
Jared Sohn
2015/05/27 14:52:02
done
|
+ { |
+ chrome.test.assertEq(expectedMutedCause, updatedTab.mutedCause); |
+ chrome.test.assertEq(expectedMuted, updatedTab.muted); |
+ stream1.stop(); |
+ chrome.test.succeed(); |
+ } |
+ }); |
+ |
+ chrome.tabs.update(tab.id, {muted: true}, function(newTab) { |
+ setTimeout(function() { |
+ tabCapture.capture({audio: true}, function(stream) { |
+ stream1 = stream; |
+ }); |
+ }, 200); |
not at google - send to devlin
2015/05/26 23:09:46
Ideally you wouldn't need any timeout and the call
Jared Sohn
2015/05/27 14:52:02
Right; the test fails without the timeout. In prio
not at google - send to devlin
2015/05/28 23:04:42
Mm this is problematic then. Timeout is just going
miu
2015/05/28 23:36:59
Explanation: The content API events propagate thro
not at google - send to devlin
2015/06/01 20:33:56
Ok, thanks for the explanation. Would my suggestio
Jared Sohn
2015/06/02 08:54:38
miu: Are you saying that there is a delay before t
not at google - send to devlin
2015/06/02 18:26:43
Ok: should we just forget about this portion of th
|
+ }); |
+ }); |
+ }, |
+ |
function onlyVideo() { |
tabCapture.capture({video: true}, function(stream) { |
chrome.test.assertTrue(!!stream); |