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

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

Issue 8789018: Revert 113047 - Make ExtensionService use ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_apitest.cc
===================================================================
--- chrome/browser/extensions/extension_apitest.cc (revision 113069)
+++ chrome/browser/extensions/extension_apitest.cc (working copy)
@@ -202,29 +202,28 @@
}
}
-// Test that exactly one extension is loaded, and return it.
+// Test that exactly one extension loaded.
const Extension* ExtensionApiTest::GetSingleLoadedExtension() {
ExtensionService* service = browser()->profile()->GetExtensionService();
- const Extension* extension = NULL;
- for (ExtensionSet::const_iterator it = service->extensions()->begin();
- it != service->extensions()->end(); ++it) {
+ int found_extension_index = -1;
+ for (size_t i = 0; i < service->extensions()->size(); ++i) {
// Ignore any component extensions. They are automatically loaded into all
// profiles and aren't the extension we're looking for here.
- if ((*it)->location() == Extension::COMPONENT)
+ if (service->extensions()->at(i)->location() == Extension::COMPONENT)
continue;
- if (extension != NULL) {
- // TODO(yoz): this is misleading; it counts component extensions.
+ if (found_extension_index != -1) {
message_ = base::StringPrintf(
"Expected only one extension to be present. Found %u.",
static_cast<unsigned>(service->extensions()->size()));
return NULL;
}
- extension = *it;
+ found_extension_index = static_cast<int>(i);
}
+ const Extension* extension = service->extensions()->at(found_extension_index);
if (!extension) {
message_ = "extension pointer is NULL.";
return NULL;
Property changes on: chrome/browser/extensions/extension_apitest.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « chrome/browser/extensions/component_loader_unittest.cc ('k') | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698