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

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc

Issue 11414230: Declarative Web Request: firstPartyForCookiesUrl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased + attribute description in JSON changed Created 7 years, 11 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
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 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action .h" 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action .h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit ion.h" 9 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit ion.h"
10 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_consta nts.h" 10 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_consta nts.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 WebRequestActionSet::AnyVector actions; 132 WebRequestActionSet::AnyVector actions;
133 actions.push_back(linked_ptr<base::Value>(redirect.DeepCopy())); 133 actions.push_back(linked_ptr<base::Value>(redirect.DeepCopy()));
134 134
135 action_set = WebRequestActionSet::Create(actions, &error, &bad_message); 135 action_set = WebRequestActionSet::Create(actions, &error, &bad_message);
136 EXPECT_EQ("", error); 136 EXPECT_EQ("", error);
137 EXPECT_FALSE(bad_message); 137 EXPECT_FALSE(bad_message);
138 138
139 // Check that redirect works on regular URLs but not on protected URLs. 139 // Check that redirect works on regular URLs but not on protected URLs.
140 net::TestURLRequest regular_request(GURL("http://test.com"), NULL, &context); 140 net::TestURLRequest regular_request(GURL("http://test.com"), NULL, &context);
141 std::list<LinkedPtrEventResponseDelta> deltas; 141 std::list<LinkedPtrEventResponseDelta> deltas;
142 DeclarativeWebRequestData request_data(&regular_request, ON_BEFORE_REQUEST); 142 WebRequestData request_data(&regular_request, ON_BEFORE_REQUEST);
143 WebRequestAction::ApplyInfo apply_info = { 143 WebRequestAction::ApplyInfo apply_info = {
144 NULL, request_data, false, &deltas 144 NULL, request_data, false, &deltas
145 }; 145 };
146 action_set->Apply("ext1", base::Time(), &apply_info); 146 action_set->Apply("ext1", base::Time(), &apply_info);
147 EXPECT_EQ(1u, deltas.size()); 147 EXPECT_EQ(1u, deltas.size());
148 148
149 net::TestURLRequest protected_request(GURL("http://clients1.google.com"), 149 net::TestURLRequest protected_request(GURL("http://clients1.google.com"),
150 NULL, &context); 150 NULL, &context);
151 deltas.clear(); 151 deltas.clear();
152 request_data = 152 request_data = WebRequestData(&protected_request, ON_BEFORE_REQUEST);
153 DeclarativeWebRequestData(&protected_request, ON_BEFORE_REQUEST); 153 // Note that we just updated the request_data reference in apply_info.
154 action_set->Apply("ext1", base::Time(), &apply_info); 154 action_set->Apply("ext1", base::Time(), &apply_info);
155 EXPECT_EQ(0u, deltas.size()); 155 EXPECT_EQ(0u, deltas.size());
156 } 156 }
157 157
158 } // namespace extensions 158 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698