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

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: Merge with ToT 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 using testing::HasSubstr; 42 using testing::HasSubstr;
43 43
44 namespace helpers = extension_web_request_api_helpers; 44 namespace helpers = extension_web_request_api_helpers;
45 namespace keys = declarative_webrequest_constants; 45 namespace keys = declarative_webrequest_constants;
46 namespace keys2 = url_matcher_constants; 46 namespace keys2 = url_matcher_constants;
47 47
48 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { 48 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry {
49 public: 49 public:
50 explicit TestWebRequestRulesRegistry( 50 explicit TestWebRequestRulesRegistry(
51 scoped_refptr<ExtensionInfoMap> extension_info_map) 51 scoped_refptr<ExtensionInfoMap> extension_info_map)
52 : WebRequestRulesRegistry(NULL /*profile*/, NULL /*ui_part*/), 52 : WebRequestRulesRegistry(NULL /*profile*/),
53 num_clear_cache_calls_(0) { 53 num_clear_cache_calls_(0) {
54 SetExtensionInfoMapForTesting(extension_info_map); 54 SetExtensionInfoMapForTesting(extension_info_map);
55 } 55 }
56 56
57 // Returns how often the in-memory caches of the renderers were instructed 57 // Returns how often the in-memory caches of the renderers were instructed
58 // to be cleared. 58 // to be cleared.
59 int num_clear_cache_calls() const { return num_clear_cache_calls_; } 59 int num_clear_cache_calls() const { return num_clear_cache_calls_; }
60 60
61 // How many rules are there which have some conditions not triggered by URL 61 // How many rules are there which have some conditions not triggered by URL
62 // matches. 62 // matches.
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 // This is a correct match. 796 // This is a correct match.
797 GURL url2("http://foo.com/index.html"); 797 GURL url2("http://foo.com/index.html");
798 net::TestURLRequest request2(url2, NULL, &context, NULL); 798 net::TestURLRequest request2(url2, NULL, &context, NULL);
799 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST); 799 WebRequestData request_data2(&request2, ON_BEFORE_REQUEST);
800 deltas = registry->CreateDeltas(NULL, request_data2, false); 800 deltas = registry->CreateDeltas(NULL, request_data2, false);
801 EXPECT_EQ(1u, deltas.size()); 801 EXPECT_EQ(1u, deltas.size());
802 } 802 }
803 803
804 } // namespace extensions 804 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698