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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc

Issue 154473002: Support redirectUrl at onHeadersReceived in WebRequest / DWR API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix WebRequestRulesRegistrySimpleTest.StageChecker test Created 6 years, 9 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/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
index 7ef5524b7e58c30ce60d0c99fc518989b3520daf..0efc9274c26b9c66fc177b3cac73c26a0555a203 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
@@ -667,26 +667,28 @@ TEST_F(WebRequestRulesRegistryTest, GetMatchesDifferentUrls) {
TEST(WebRequestRulesRegistrySimpleTest, StageChecker) {
// The contentType condition can only be evaluated during ON_HEADERS_RECEIVED
- // but the redirect action can only be executed during ON_BEFORE_REQUEST.
+ // but the SetRequestHeader action can only be executed during
+ // ON_BEFORE_SEND_HEADERS.
// Therefore, this is an inconsistent rule that needs to be flagged.
const char kRule[] =
- "{ \n"
- " \"id\": \"rule1\", \n"
- " \"conditions\": [ \n"
- " { \n"
- " \"instanceType\": \"declarativeWebRequest.RequestMatcher\", \n"
- " \"url\": {\"hostSuffix\": \"foo.com\"}, \n"
- " \"contentType\": [\"image/jpeg\"] \n"
- " } \n"
- " ], \n"
- " \"actions\": [ \n"
- " { \n"
- " \"instanceType\": \"declarativeWebRequest.RedirectRequest\",\n"
- " \"redirectUrl\": \"http://bar.com\" \n"
- " } \n"
- " ], \n"
- " \"priority\": 200 \n"
- "} ";
+ "{ \n"
+ " \"id\": \"rule1\", \n"
+ " \"conditions\": [ \n"
+ " { \n"
+ " \"instanceType\": \"declarativeWebRequest.RequestMatcher\", \n"
+ " \"url\": {\"hostSuffix\": \"foo.com\"}, \n"
+ " \"contentType\": [\"image/jpeg\"] \n"
+ " } \n"
+ " ], \n"
+ " \"actions\": [ \n"
+ " { \n"
+ " \"instanceType\": \"declarativeWebRequest.SetRequestHeader\",\n"
+ " \"name\": \"Content-Type\", \n"
+ " \"value\": \"text/plain\" \n"
+ " } \n"
+ " ], \n"
+ " \"priority\": 200 \n"
+ "} ";
scoped_ptr<base::Value> value(base::JSONReader::Read(kRule));
ASSERT_TRUE(value);

Powered by Google App Engine
This is Rietveld 408576698