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

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

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Reports the number of rules registered for the |extension_id| with the 106 // Reports the number of rules registered for the |extension_id| with the
107 // non-webview rules registry. 107 // non-webview rules registry.
108 size_t NumberOfRegisteredRules(const std::string& extension_id) { 108 size_t NumberOfRegisteredRules(const std::string& extension_id) {
109 RulesRegistryService* rules_registry_service = 109 RulesRegistryService* rules_registry_service =
110 extensions::RulesRegistryService::Get(browser()->profile()); 110 extensions::RulesRegistryService::Get(browser()->profile());
111 scoped_refptr<RulesRegistry> rules_registry = 111 scoped_refptr<RulesRegistry> rules_registry =
112 rules_registry_service->GetRulesRegistry( 112 rules_registry_service->GetRulesRegistry(
113 RulesRegistryService::kDefaultRulesRegistryID, 113 RulesRegistryService::kDefaultRulesRegistryID,
114 extensions::declarative_webrequest_constants::kOnRequest); 114 extensions::declarative_webrequest_constants::kOnRequest);
115 115
116 std::vector<linked_ptr<core_api::events::Rule>> rules; 116 std::vector<linked_ptr<api::events::Rule>> rules;
117 BrowserThread::PostTask( 117 BrowserThread::PostTask(
118 BrowserThread::IO, 118 BrowserThread::IO,
119 FROM_HERE, 119 FROM_HERE,
120 base::Bind( 120 base::Bind(
121 &RulesRegistry::GetAllRules, rules_registry, extension_id, &rules)); 121 &RulesRegistry::GetAllRules, rules_registry, extension_id, &rules));
122 scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper( 122 scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper(
123 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); 123 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()));
124 EXPECT_TRUE(io_helper->Run()); 124 EXPECT_TRUE(io_helper->Run());
125 return rules.size(); 125 return rules.size();
126 } 126 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 // 2. Uninstall the extension. Rules are gone and preferences should be empty. 247 // 2. Uninstall the extension. Rules are gone and preferences should be empty.
248 UninstallExtension(extension_id); 248 UninstallExtension(extension_id);
249 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl)); 249 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
250 EXPECT_NE(kTestTitle, GetTitle()); 250 EXPECT_NE(kTestTitle, GetTitle());
251 EXPECT_EQ(0u, NumberOfRegisteredRules(extension_id)); 251 EXPECT_EQ(0u, NumberOfRegisteredRules(extension_id));
252 EXPECT_FALSE(extension_prefs->HasPrefForExtension(extension_id)); 252 EXPECT_FALSE(extension_prefs->HasPrefForExtension(extension_id));
253 } 253 }
254 254
255 } // namespace extensions 255 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698