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

Unified Diff: chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_disabled.js

Issue 10784009: screenshot disabling policy tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@disable_screenshots
Patch Set: Rebased Created 8 years, 3 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/tabs/capture_visible_tab/test_disabled.js
diff --git a/chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_nofile.js b/chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_disabled.js
similarity index 57%
copy from chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_nofile.js
copy to chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_disabled.js
index 56ccc5030269551524a41e6ead585aa9def22481..6ec651c98fbb5a3caa5f192e208962dcf07efdbd 100644
--- a/chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_nofile.js
+++ b/chrome/test/data/extensions/api_test/tabs/capture_visible_tab/test_disabled.js
@@ -1,9 +1,9 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
-// API test for chrome.tabs.captureVisibleTab(), capturing JPEG images.
-// browser_tests.exe --gtest_filter=ExtensionApiTest.CaptureVisibleNoFile
+// API test for chrome.tabs.captureVisibleTab(), screenshot disabling policy.
+// browser_tests.exe --gtest_filter=ExtensionApiTest.CaptureVisibleDisabled
var pass = chrome.test.callbackPass;
var fail = chrome.test.callbackFail;
@@ -19,26 +19,25 @@ var kWindowRect = {
var fail_url = "file:///nosuch.html";
chrome.test.runTests([
- // Check that test infrastructure launched us without permissions.
- function checkAllowedNoAccess() {
- chrome.extension.isAllowedFileSchemeAccess(pass(function(hasAccess) {
- assertFalse(hasAccess);
- }));
- },
-
- // Check for no permssions error.
- function captureVisibleNoFile() {
+ function captureVisibleDisabled() {
createWindow([fail_url], kWindowRect, pass(function(winId, tabIds) {
waitForAllTabs(pass(function() {
chrome.tabs.getSelected(winId, pass(function(tab) {
assertEq('complete', tab.status);
chrome.tabs.captureVisibleTab(winId, fail(
- 'Cannot access contents of url "' + fail_url +
- '". Extension manifest must request permission ' +
- 'to access this host.'));
+ 'Taking screenshots has been disabled'));
}));
}));
}));
- }
+ },
+
+ function captureVisibleDisabledInNullWindow() {
+ chrome.tabs.captureVisibleTab(null, fail(
+ 'Taking screenshots has been disabled'));
+ },
+ function captureVisibleDisabledInCurrentWindow() {
+ chrome.tabs.captureVisibleTab(chrome.windows.WINDOW_ID_CURRENT,
+ fail('Taking screenshots has been disabled'));
+ }
]);

Powered by Google App Engine
This is Rietveld 408576698