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

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

Issue 10874029: Adding condition attributes for response headers to Declarative WebRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/webrequest/declarative/headers.html.mock-http-headers ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var onRequest = chrome.declarativeWebRequest.onRequest; 5 var onRequest = chrome.declarativeWebRequest.onRequest;
6 var AddResponseHeader = 6 var AddResponseHeader =
7 chrome.declarativeWebRequest.AddResponseHeader; 7 chrome.declarativeWebRequest.AddResponseHeader;
8 var RequestMatcher = chrome.declarativeWebRequest.RequestMatcher; 8 var RequestMatcher = chrome.declarativeWebRequest.RequestMatcher;
9 var CancelRequest = chrome.declarativeWebRequest.CancelRequest; 9 var CancelRequest = chrome.declarativeWebRequest.CancelRequest;
10 var RedirectByRegEx = chrome.declarativeWebRequest.RedirectByRegEx; 10 var RedirectByRegEx = chrome.declarativeWebRequest.RedirectByRegEx;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 onRequest.addRules( 98 onRequest.addRules(
99 [ {'conditions': [ 99 [ {'conditions': [
100 new RequestMatcher({ 100 new RequestMatcher({
101 'url': { 101 'url': {
102 'pathSuffix': ".html", 102 'pathSuffix': ".html",
103 'ports': [testServerPort, [1000, 2000]], 103 'ports': [testServerPort, [1000, 2000]],
104 'schemes': ["http"] 104 'schemes': ["http"]
105 }, 105 },
106 'resourceType': ["main_frame"], 106 'resourceType': ["main_frame"],
107 'contentType': ["text/plain"], 107 'contentType': ["text/plain"],
108 'excludeContentType': ["image/png"]})], 108 'excludeContentType': ["image/png"],
109 'responseHeaders': [{ nameContains: ["content", "type"] } ],
110 'excludeResponseHeaders': [{ valueContains: "nonsense" }] })],
109 'actions': [new CancelRequest()]} 111 'actions': [new CancelRequest()]}
110 ], 112 ],
111 function() {navigateAndWait(getURLHttpWithHeaders());} 113 function() {navigateAndWait(getURLHttpWithHeaders());}
112 ); 114 );
113 }, 115 },
114 116
115 function testRedirectRequest() { 117 function testRedirectRequest() {
116 ignoreUnexpected = true; 118 ignoreUnexpected = true;
117 expect( 119 expect(
118 [ 120 [
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 this.status + ", responseText: " + this.responseText); 470 this.status + ", responseText: " + this.responseText);
469 } 471 }
470 } 472 }
471 req.open("GET", getURLHttpXHRData(), asynchronous); 473 req.open("GET", getURLHttpXHRData(), asynchronous);
472 req.send(null); 474 req.send(null);
473 }); 475 });
474 } 476 }
475 ); 477 );
476 }, 478 },
477 ]); 479 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/webrequest/declarative/headers.html.mock-http-headers ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698