summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/extensions/api_test/webrequest/test_declarative.js33
1 files changed, 32 insertions, 1 deletions
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 9edb294..6d54189 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());}
+ );
+ },
]);