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

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_nofile.js

Issue 140433003: tab capture: Change the permissions for tabs.captureVisibleTab(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // API test for chrome.tabs.captureVisibleTab(), capturing JPEG images.
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.CaptureVisibleNoFile
7
8 var pass = chrome.test.callbackPass;
9 var fail = chrome.test.callbackFail;
10 var assertEq = chrome.test.assertEq;
11 var assertTrue = chrome.test.assertTrue;
12 var assertFalse = chrome.test.assertFalse;
13
14 var kWindowRect = {
15 'width': 400,
16 'height': 400
17 };
18
19 var fail_url = "file:///nosuch.html";
20
21 chrome.test.runTests([
22 // Check that test infrastructure launched us without permissions.
23 function checkAllowedNoAccess() {
24 chrome.extension.isAllowedFileSchemeAccess(pass(function(hasAccess) {
25 assertFalse(hasAccess);
26 }));
27 },
28
29 // Check for no permssions error.
30 function captureVisibleNoFile() {
31 createWindow([fail_url], kWindowRect, pass(function(winId, tabIds) {
32 waitForAllTabs(pass(function() {
33 chrome.tabs.getSelected(winId, pass(function(tab) {
34 assertEq('complete', tab.status);
35 chrome.tabs.captureVisibleTab(winId, fail(
36 'Cannot access contents of url "' + fail_url +
37 '". Extension manifest must request permission ' +
38 'to access this host.'));
39 }));
40 }));
41 }));
42 }
43
44 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_nofile.html ('k') | extensions/common/manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698