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

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

Issue 10825212: Support also excluding content types in declarative webrequest conditions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ' Created 8 years, 4 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/common/extensions/docs/static/declarativeWebRequest.html ('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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 [ ["onErrorOccurred"] ]); 97 [ ["onErrorOccurred"] ]);
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/html"]})], 107 'contentType': ["text/html"],
108 'excludeContentType': ["image/png"]})],
108 'actions': [new CancelRequest()]} 109 'actions': [new CancelRequest()]}
109 ], 110 ],
110 function() {navigateAndWait(getURLHttpWithHeaders());} 111 function() {navigateAndWait(getURLHttpWithHeaders());}
111 ); 112 );
112 }, 113 },
113 114
114 function testRedirectRequest() { 115 function testRedirectRequest() {
115 ignoreUnexpected = true; 116 ignoreUnexpected = true;
116 expect( 117 expect(
117 [ 118 [
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 this.status + ", responseText: " + this.responseText); 468 this.status + ", responseText: " + this.responseText);
468 } 469 }
469 } 470 }
470 req.open("GET", getURLHttpXHRData(), asynchronous); 471 req.open("GET", getURLHttpXHRData(), asynchronous);
471 req.send(null); 472 req.send(null);
472 }); 473 });
473 } 474 }
474 ); 475 );
475 }, 476 },
476 ]); 477 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/static/declarativeWebRequest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698