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

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

Issue 11038031: Adding condition attributes for request headers to Declarative WebRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased (only). Created 8 years, 2 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
« no previous file with comments | « chrome/common/extensions/api/declarative_web_request.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/webrequest/test_declarative.js
diff --git a/chrome/test/data/extensions/api_test/webrequest/test_declarative.js b/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
index 9edb294f3d6df0154a686ca36b10c282a5dec8a6..6d54189c332fe7276dafc3d3e2da05088cf1cded 100644
--- a/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
+++ b/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
@@ -185,7 +185,7 @@ runTests([
'resourceType': ["main_frame"],
'contentType': ["text/plain"],
'excludeContentType': ["image/png"],
- 'responseHeaders': [{ nameContains: ["content", "type"] } ],
+ 'responseHeaders': [{ nameContains: ["content", "type"] }],
'excludeResponseHeaders': [{ valueContains: "nonsense" }] })],
'actions': [new CancelRequest()]}
],
@@ -619,4 +619,35 @@ runTests([
}
);
},
+
+ function testRequestHeaders() {
+ ignoreUnexpected = true;
+ expect(
+ [
+ { label: "onErrorOccurred",
+ event: "onErrorOccurred",
+ details: {
+ url: getURLHttpSimple(),
+ fromCache: false,
+ error: "net::ERR_BLOCKED_BY_CLIENT"
+ }
+ },
+ ],
+ [ ["onErrorOccurred"] ]);
+ onRequest.addRules(
+ [ {'conditions': [
+ new RequestMatcher({
+ 'url': {
+ 'pathSuffix': ".html",
+ 'ports': [testServerPort, [1000, 2000]],
+ 'schemes': ["http"]
+ },
+ 'requestHeaders': [{ nameContains: "" }],
+ 'excludeRequestHeaders': [{ valueContains: ["", "value123"] }]
+ })],
+ 'actions': [new CancelRequest()]}
+ ],
+ function() {navigateAndWait(getURLHttpSimple());}
+ );
+ },
]);
« no previous file with comments | « chrome/common/extensions/api/declarative_web_request.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698