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

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

Issue 53273002: Decouple RulesCacheDelegate from RulesRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_rules_registry_with_cache
Patch Set: Updated Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 using testing::HasSubstr; 43 using testing::HasSubstr;
44 44
45 namespace helpers = extension_web_request_api_helpers; 45 namespace helpers = extension_web_request_api_helpers;
46 namespace keys = declarative_webrequest_constants; 46 namespace keys = declarative_webrequest_constants;
47 namespace keys2 = url_matcher_constants; 47 namespace keys2 = url_matcher_constants;
48 48
49 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { 49 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry {
50 public: 50 public:
51 explicit TestWebRequestRulesRegistry( 51 explicit TestWebRequestRulesRegistry(
52 scoped_refptr<ExtensionInfoMap> extension_info_map) 52 scoped_refptr<ExtensionInfoMap> extension_info_map)
53 : WebRequestRulesRegistry(NULL /*profile*/, NULL /*ui_part*/), 53 : WebRequestRulesRegistry(NULL /*profile*/, NULL /* cache_delegate */),
54 num_clear_cache_calls_(0) { 54 num_clear_cache_calls_(0) {
55 SetExtensionInfoMapForTesting(extension_info_map); 55 SetExtensionInfoMapForTesting(extension_info_map);
56 } 56 }
57 57
58 // Returns how often the in-memory caches of the renderers were instructed 58 // Returns how often the in-memory caches of the renderers were instructed
59 // to be cleared. 59 // to be cleared.
60 int num_clear_cache_calls() const { return num_clear_cache_calls_; } 60 int num_clear_cache_calls() const { return num_clear_cache_calls_; }
61 61
62 // How many rules are there which have some conditions not triggered by URL 62 // How many rules are there which have some conditions not triggered by URL
63 // matches. 63 // matches.
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 800
801 // This is a correct match. 801 // This is a correct match.
802 GURL url2("http://foo.com/index.html"); 802 GURL url2("http://foo.com/index.html");
803 net::TestURLRequest request2(url2, net::DEFAULT_PRIORITY, NULL, &context); 803 net::TestURLRequest request2(url2, net::DEFAULT_PRIORITY, NULL, &context);
804 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST); 804 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST);
805 deltas = registry->CreateDeltas(NULL, request_data2, false); 805 deltas = registry->CreateDeltas(NULL, request_data2, false);
806 EXPECT_EQ(1u, deltas.size()); 806 EXPECT_EQ(1u, deltas.size());
807 } 807 }
808 808
809 } // namespace extensions 809 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698