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

Unified Diff: chrome/test/data/extensions/api_test/tab_capture/max_presentations.js

Issue 1221483002: New tabCapture.captureOffscreenTab API, initially for Presentation API 1UA mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/tab_capture/max_presentations.js
diff --git a/chrome/test/data/extensions/api_test/tab_capture/max_presentations.js b/chrome/test/data/extensions/api_test/tab_capture/max_presentations.js
new file mode 100644
index 0000000000000000000000000000000000000000..035489e9dcf582bd703c5efc8de22dff78683ba3
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/tab_capture/max_presentations.js
@@ -0,0 +1,56 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var tabCapture = chrome.tabCapture;
+
+var helloWorldPageUri = 'data:text/html;charset=UTF-8,' +
+ encodeURIComponent('<html><body>Hello world!</body></html>');
+
+chrome.test.runTests([
+ function canOpenUpToThreeOffscreenTabs() {
+ tabCapture.capturePresentation(
+ helloWorldPageUri,
+ '1st',
+ {video: true},
+ function(stream1) {
+ // 1st presentation capture should succeed.
+ chrome.test.assertTrue(!!stream1);
+ if (!stream1) return;
+
+ tabCapture.capturePresentation(
+ helloWorldPageUri,
+ '2nd',
+ {video: true},
+ function(stream2) {
+ // 2nd presentation capture should succeed.
+ chrome.test.assertTrue(!!stream2);
+ if (!stream2) return;
+
+ tabCapture.capturePresentation(
+ helloWorldPageUri,
+ '3rd',
+ {video: true},
+ function(stream3) {
+ // 3rd presentation capture should succeed.
+ chrome.test.assertTrue(!!stream3);
+ if (!stream3) return;
+
+ tabCapture.capturePresentation(
+ helloWorldPageUri,
+ '4th',
+ {video: true},
+ function(stream4) {
+ // 4th presentation capture should fail.
+ chrome.test.assertFalse(!!stream4);
+
+ stream3.stop();
+ stream2.stop();
+ stream1.stop();
+ chrome.test.succeed();
+ });
+ });
+ });
+ });
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698