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

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

Issue 10560013: Persist declarative rules to the extension state store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RegisterKey Created 8 years, 6 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_rules_ registry.h" 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_ registry.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 15 matching lines...) Expand all
26 } // namespace 26 } // namespace
27 27
28 namespace extensions { 28 namespace extensions {
29 29
30 namespace helpers = extension_web_request_api_helpers; 30 namespace helpers = extension_web_request_api_helpers;
31 namespace keys = declarative_webrequest_constants; 31 namespace keys = declarative_webrequest_constants;
32 namespace keys2 = url_matcher_constants; 32 namespace keys2 = url_matcher_constants;
33 33
34 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { 34 class TestWebRequestRulesRegistry : public WebRequestRulesRegistry {
35 public: 35 public:
36 TestWebRequestRulesRegistry() : WebRequestRulesRegistry(NULL) {} 36 TestWebRequestRulesRegistry() : WebRequestRulesRegistry(NULL, NULL) {}
37 37
38 protected: 38 protected:
39 virtual ~TestWebRequestRulesRegistry() {} 39 virtual ~TestWebRequestRulesRegistry() {}
40 40
41 virtual base::Time GetExtensionInstallationTime( 41 virtual base::Time GetExtensionInstallationTime(
42 const std::string& extension_id) const { 42 const std::string& extension_id) const {
43 if (extension_id == kExtensionId) 43 if (extension_id == kExtensionId)
44 return base::Time() + base::TimeDelta::FromDays(1); 44 return base::Time() + base::TimeDelta::FromDays(1);
45 else if (extension_id == kExtensionId2) 45 else if (extension_id == kExtensionId2)
46 return base::Time() + base::TimeDelta::FromDays(2); 46 return base::Time() + base::TimeDelta::FromDays(2);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // The redirect by the first extension is ignored due to the ignore rule. 389 // The redirect by the first extension is ignored due to the ignore rule.
390 ASSERT_EQ(1u, deltas.size()); 390 ASSERT_EQ(1u, deltas.size());
391 LinkedPtrEventResponseDelta effective_rule = *(deltas.begin()); 391 LinkedPtrEventResponseDelta effective_rule = *(deltas.begin());
392 392
393 EXPECT_EQ(kExtensionId2, effective_rule->extension_id); 393 EXPECT_EQ(kExtensionId2, effective_rule->extension_id);
394 EXPECT_EQ(base::Time() + base::TimeDelta::FromDays(2), 394 EXPECT_EQ(base::Time() + base::TimeDelta::FromDays(2),
395 effective_rule->extension_install_time); 395 effective_rule->extension_install_time);
396 EXPECT_EQ(GURL("http://www.bar.com"), effective_rule->new_url); 396 EXPECT_EQ(GURL("http://www.bar.com"), effective_rule->new_url);
397 } 397 }
398 } // namespace extensions 398 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698