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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_action_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_action_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
index 4952dc8199dcb98ff8a2a0b8828babec9214b79c..fbb7aa69a76b698d437c8ab2d247603236526a67 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
@@ -279,6 +279,7 @@ TEST_F(WebRequestActionWithThreadsTest, PermissionsToRedirect) {
" \"redirectUrl\": \"http://www.foobar.com\""
"}]";
CheckActionNeedsAllUrls(kAction, ON_BEFORE_REQUEST);
+ CheckActionNeedsAllUrls(kAction, ON_HEADERS_RECEIVED);
}
TEST_F(WebRequestActionWithThreadsTest, PermissionsToRedirectByRegEx) {
@@ -442,6 +443,10 @@ TEST_F(WebRequestActionWithThreadsTest,
extension_->id(),
action_set.get(),
ON_BEFORE_REQUEST));
+ EXPECT_TRUE(ActionWorksOnRequest("http://test.org",
+ extension_->id(),
+ action_set.get(),
+ ON_HEADERS_RECEIVED));
}
TEST_F(WebRequestActionWithThreadsTest, PermissionsToRedirectToEmptyDocument) {
@@ -456,6 +461,10 @@ TEST_F(WebRequestActionWithThreadsTest, PermissionsToRedirectToEmptyDocument) {
extension_->id(),
action_set.get(),
ON_BEFORE_REQUEST));
+ EXPECT_TRUE(ActionWorksOnRequest("http://test.org",
+ extension_->id(),
+ action_set.get(),
+ ON_HEADERS_RECEIVED));
}
TEST_F(WebRequestActionWithThreadsTest, PermissionsToIgnore) {

Powered by Google App Engine
This is Rietveld 408576698