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..c9621e84b06b5e8818ef2a4ea5adaea3b5360cd3 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 |
@@ -29,7 +29,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 +97,34 @@ chrome.test.runTests([ |
}); |
}, |
+ function tabIsUnmutedWhenTabCaptured() { |
+ var stream1 = null; |
+ |
+ chrome.tabs.getCurrent(function(tab) { |
+ chrome.test.listenForever(chrome.tabs.onUpdated, |
not at google - send to devlin
2015/06/04 00:00:05
you should also stop listening to this,
var stopL
|
+ function(tabId, changeInfo, updatedTab) { |
+ var expectedMutedCause = "capture"; |
+ var expectedMuted = false; |
not at google - send to devlin
2015/06/04 00:00:05
I actually find these harder to read than just
if
|
+ |
+ if ((changeInfo["mutedCause"] == expectedMutedCause) && |
+ (changeInfo["muted"] === expectedMuted)) { |
+ 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/06/04 00:00:05
Ok, I see your point. This is hard to fit into som
|
+ }); |
+ }, |
+ |
function onlyVideo() { |
tabCapture.capture({video: true}, function(stream) { |
chrome.test.assertTrue(!!stream); |