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

Side by Side Diff: chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc

Issue 52743002: Declarative rules should be removed on uninstalling, not unloading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further comments addressed Created 7 years 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/rules_registry_service.h" 5 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h" 9 #include "chrome/browser/extensions/api/declarative/test_rules_registry.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 base::Bind(&VerifyNumberOfRules, 87 base::Bind(&VerifyNumberOfRules,
88 registry_service.GetRulesRegistry(key, "ui"), 1)); 88 registry_service.GetRulesRegistry(key, "ui"), 1));
89 89
90 content::BrowserThread::PostTask( 90 content::BrowserThread::PostTask(
91 content::BrowserThread::IO, FROM_HERE, 91 content::BrowserThread::IO, FROM_HERE,
92 base::Bind(&VerifyNumberOfRules, 92 base::Bind(&VerifyNumberOfRules,
93 registry_service.GetRulesRegistry(key, "io"), 1)); 93 registry_service.GetRulesRegistry(key, "io"), 1));
94 94
95 message_loop_.RunUntilIdle(); 95 message_loop_.RunUntilIdle();
96 96
97 // Test extension unloading. 97 // Test extension uninstalling.
98 98
99 registry_service.SimulateExtensionUnloaded(kExtensionId); 99 registry_service.SimulateExtensionUninstalled(kExtensionId);
100 100
101 content::BrowserThread::PostTask( 101 content::BrowserThread::PostTask(
102 content::BrowserThread::UI, FROM_HERE, 102 content::BrowserThread::UI, FROM_HERE,
103 base::Bind(&VerifyNumberOfRules, 103 base::Bind(&VerifyNumberOfRules,
104 registry_service.GetRulesRegistry(key, "ui"), 0)); 104 registry_service.GetRulesRegistry(key, "ui"), 0));
105 105
106 content::BrowserThread::PostTask( 106 content::BrowserThread::PostTask(
107 content::BrowserThread::IO, FROM_HERE, 107 content::BrowserThread::IO, FROM_HERE,
108 base::Bind(&VerifyNumberOfRules, 108 base::Bind(&VerifyNumberOfRules,
109 registry_service.GetRulesRegistry(key, "io"), 0)); 109 registry_service.GetRulesRegistry(key, "io"), 0));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 RulesRegistryService registry_service(&profile); 155 RulesRegistryService registry_service(&profile);
156 RulesRegistry* registry = 156 RulesRegistry* registry =
157 registry_service.GetRulesRegistry( 157 registry_service.GetRulesRegistry(
158 key, 158 key,
159 declarative_webrequest_constants::kOnRequest).get(); 159 declarative_webrequest_constants::kOnRequest).get();
160 EXPECT_TRUE(registry); 160 EXPECT_TRUE(registry);
161 EXPECT_FALSE(registry->rules_cache_delegate_for_testing()); 161 EXPECT_FALSE(registry->rules_cache_delegate_for_testing());
162 } 162 }
163 163
164 } // namespace extensions 164 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698