OLD | NEW |
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 Loading... |
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 Loading... |
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 ]); |
OLD | NEW |