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 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 "web_request_all_host_permissions.json", | 247 "web_request_all_host_permissions.json", |
248 Manifest::INVALID_LOCATION, | 248 Manifest::INVALID_LOCATION, |
249 Extension::NO_FLAGS, | 249 Extension::NO_FLAGS, |
250 kExtensionId2, | 250 kExtensionId2, |
251 &error); | 251 &error); |
252 ASSERT_TRUE(extension2_.get()) << error; | 252 ASSERT_TRUE(extension2_.get()) << error; |
253 extension_info_map_ = new InfoMap; | 253 extension_info_map_ = new InfoMap; |
254 ASSERT_TRUE(extension_info_map_.get()); | 254 ASSERT_TRUE(extension_info_map_.get()); |
255 extension_info_map_->AddExtension(extension_.get(), | 255 extension_info_map_->AddExtension(extension_.get(), |
256 base::Time() + base::TimeDelta::FromDays(1), | 256 base::Time() + base::TimeDelta::FromDays(1), |
257 false /*incognito_enabled*/); | 257 false /*incognito_enabled*/, |
| 258 false /*notifications_disabled*/); |
258 extension_info_map_->AddExtension(extension2_.get(), | 259 extension_info_map_->AddExtension(extension2_.get(), |
259 base::Time() + base::TimeDelta::FromDays(2), | 260 base::Time() + base::TimeDelta::FromDays(2), |
260 false /*incognito_enabled*/); | 261 false /*incognito_enabled*/, |
| 262 false /*notifications_disabled*/); |
261 } | 263 } |
262 | 264 |
263 | 265 |
264 TEST_F(WebRequestRulesRegistryTest, AddRulesImpl) { | 266 TEST_F(WebRequestRulesRegistryTest, AddRulesImpl) { |
265 scoped_refptr<TestWebRequestRulesRegistry> registry( | 267 scoped_refptr<TestWebRequestRulesRegistry> registry( |
266 new TestWebRequestRulesRegistry(extension_info_map_)); | 268 new TestWebRequestRulesRegistry(extension_info_map_)); |
267 std::string error; | 269 std::string error; |
268 | 270 |
269 std::vector<linked_ptr<RulesRegistry::Rule> > rules; | 271 std::vector<linked_ptr<RulesRegistry::Rule> > rules; |
270 rules.push_back(CreateRule1()); | 272 rules.push_back(CreateRule1()); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 802 |
801 // This is a correct match. | 803 // This is a correct match. |
802 GURL url2("http://foo.com/index.html"); | 804 GURL url2("http://foo.com/index.html"); |
803 net::TestURLRequest request2(url2, net::DEFAULT_PRIORITY, NULL, &context); | 805 net::TestURLRequest request2(url2, net::DEFAULT_PRIORITY, NULL, &context); |
804 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST); | 806 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST); |
805 deltas = registry->CreateDeltas(NULL, request_data2, false); | 807 deltas = registry->CreateDeltas(NULL, request_data2, false); |
806 EXPECT_EQ(1u, deltas.size()); | 808 EXPECT_EQ(1u, deltas.size()); |
807 } | 809 } |
808 | 810 |
809 } // namespace extensions | 811 } // namespace extensions |
OLD | NEW |