| 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();
|
| + });
|
| + });
|
| + });
|
| + });
|
| + }
|
| +]);
|
|
|