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

Unified Diff: chrome/browser/extensions/extension_startup_browsertest.cc

Issue 8733004: Make ExtensionService use ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: = Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_startup_browsertest.cc
diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc
index 835d274b4a622622f3273b12d8f9e15b15f9a881..8b29ce10670bf5c06730593ea5a1f6736031d972 100644
--- a/chrome/browser/extensions/extension_startup_browsertest.cc
+++ b/chrome/browser/extensions/extension_startup_browsertest.cc
@@ -83,9 +83,11 @@ class ExtensionStartupTestBase : public InProcessBrowserTest {
// Count the number of non-component extensions.
int found_extensions = 0;
- for (size_t i = 0; i < service->extensions()->size(); i++)
- if (service->extensions()->at(i)->location() != Extension::COMPONENT)
+ for (ExtensionSet::const_iterator it = service->extensions()->begin();
+ it != service->extensions()->end(); ++it) {
+ if ((*it)->location() != Extension::COMPONENT)
found_extensions++;
+ }
ASSERT_EQ(static_cast<uint32>(num_expected_extensions),
static_cast<uint32>(found_extensions));
@@ -164,14 +166,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) {
WaitForServicesToStart(num_expected_extensions_, true);
ExtensionService* service = browser()->profile()->GetExtensionService();
- for (size_t i = 0; i < service->extensions()->size(); ++i) {
- if (service->extensions()->at(i)->location() == Extension::COMPONENT)
+ for (ExtensionSet::const_iterator it = service->extensions()->begin();
+ it != service->extensions()->end(); ++it) {
+ if ((*it)->location() == Extension::COMPONENT)
continue;
- if (service->AllowFileAccess(service->extensions()->at(i))) {
+ if (service->AllowFileAccess(*it)) {
ui_test_utils::WindowedNotificationObserver user_scripts_observer(
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
content::NotificationService::AllSources());
- service->SetAllowFileAccess(service->extensions()->at(i), false);
+ service->SetAllowFileAccess(*it, false);
user_scripts_observer.Wait();
}
}

Powered by Google App Engine
This is Rietveld 408576698