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

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: Removed 0-sized arrays. 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
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 91fb9aeafcb8f1ec5b54b4f52b136cd8c598f889..02d998e6c1db68d2106177a1e465c967b7a48fcf 100644
--- a/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
+++ b/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
@@ -106,7 +106,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()]}
],
@@ -504,4 +504,35 @@ runTests([
}
);
},
+
+ function testRequestHeaders() {
+ ignoreUnexpected = true;
+ expect(
+ [
+ { label: "onErrorOccurred",
+ event: "onErrorOccurred",
+ details: {
+ url: getURLHttpWithHeaders(),
+ 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(getURLHttpWithHeaders());}
battre 2012/10/05 12:50:03 This URL returns a response with specific headers.
battre 2012/10/05 15:45:49 As discussed, I think that the unit tests in combi
vabr (Chromium) 2012/10/05 15:56:53 OK. I at least changed the URL to something more s
+ );
+ },
]);

Powered by Google App Engine
This is Rietveld 408576698