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

Unified Diff: chrome/test/data/extensions/api_test/webrequest/test_declarative_permissions.js

Issue 14358004: Almost all actions in Declarative Web Request require all_urls host permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: All URLs -> all hosts; also rebased Created 7 years, 8 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/webrequest/test_declarative_permissions.js
diff --git a/chrome/test/data/extensions/api_test/webrequest/test_declarative_permissions.js b/chrome/test/data/extensions/api_test/webrequest/test_declarative_permissions.js
deleted file mode 100644
index 9609a34c9da3624293bf8e859b69ee5a69f240f0..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/webrequest/test_declarative_permissions.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// 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.
-
-// See permissionless/rules.js for the rules that this test uses.
-
-runTests([
- // Test that it's possible to redirect within the same domain and port
- // (ignoring the scheme) without host permissions.
- function testRedirectSameDomain() {
- ignoreUnexpected = true;
- var testURL = getServerURL(
- 'files/extensions/api_test/webrequest/simpleLoad/a.html',
- 'www.a.com', 'https');
- expect(
- [
- { label: 'onBeforeRedirect',
- event: 'onBeforeRedirect',
- details: {
- url: testURL,
- redirectUrl: getServerURL('files/nonexistent/redirected'),
- statusCode: -1,
- statusLine: '',
- fromCache: false,
- }
- },
- ],
- [ ['onBeforeRedirect'] ]
- );
- navigateAndWait(testURL);
- },
-
- // Test that it's not possible to redirect to a different domain
- // without host permissions on the original domain. We should still
- // load the original URL.
- function testCannotRedirectDifferentDomains() {
- ignoreUnexpected = true;
- var testURL = getServerURL(
- 'files/extensions/api_test/webrequest/simpleLoad/b.html');
- expect(
- [
- { label: 'onCompleted',
- event: 'onCompleted',
- details: {
- url: testURL,
- fromCache: false,
- ip: '127.0.0.1',
- statusCode: 200,
- statusLine: 'HTTP/1.0 200 OK',
- }
- },
- ],
- [ ['onCompleted'] ]
- );
- navigateAndWait(testURL);
- },
-
- // Test that it's possible to redirect by regex within the same
- // domain and port (ignoring the scheme) without host permissions.
- function testRedirectByRegexSameDomain() {
- ignoreUnexpected = true;
- var testURL = getServerURL(
- 'files/extensions/api_test/webrequest/simpleLoad/fake.html');
- expect(
- [
- { label: 'onBeforeRedirect',
- event: 'onBeforeRedirect',
- details: {
- url: testURL,
- redirectUrl: getServerURL(
- 'files/extensions/api_test/webrequest/simpleLoad/b.html'),
- statusCode: -1,
- statusLine: '',
- fromCache: false,
- }
- },
- ],
- [ ['onBeforeRedirect'] ]
- );
- navigateAndWait(testURL);
- },
-
- // Test that it's possible to redirect to a blank page/image
- // without host permissions.
- function testRedirectToEmpty() {
- var testURL = getServerURL('files/nonexistent/blank.html');
- ignoreUnexpected = true;
- expect(
- [
- { label: 'onBeforeRedirect',
- event: 'onBeforeRedirect',
- details: {
- url: testURL,
- redirectUrl: 'data:text/html,',
- statusCode: -1,
- statusLine: '',
- fromCache: false,
- }
- },
- ],
- [ ['onBeforeRedirect'] ]
- );
- navigateAndWait(testURL);
- },
-
- // Test that it's possible to cancel a request without host permissions.
- function testCancelRequest() {
- ignoreUnexpected = true;
- var testURL = getServerURL('files/nonexistent/cancel.html');
- expect(
- [
- { label: 'onErrorOccurred',
- event: 'onErrorOccurred',
- details: {
- url: testURL,
- fromCache: false,
- error: 'net::ERR_BLOCKED_BY_CLIENT'
- }
- },
- ],
- [ ['onErrorOccurred'] ]
- );
- navigateAndWait(testURL);
- },
-
-]);

Powered by Google App Engine
This is Rietveld 408576698