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

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

Issue 8733004: 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_browsertest.cc
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index b3f3d1b5cfba0d1180dd25a02eabd0256011bb99..339a28c0c8de687966228de8cbdacf95ccc980a2 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -72,13 +72,13 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithOptions(
ui_test_utils::RunMessageLoop();
}
- // Find the extension by iterating backwards since it is likely last.
+ // Find the loaded extension by its path. See crbug.com/59531 for why
+ // we cannot just use last_loaded_extension_id_.
FilePath extension_path = path;
file_util::AbsolutePath(&extension_path);
const Extension* extension = NULL;
- for (ExtensionList::const_reverse_iterator iter =
- service->extensions()->rbegin();
- iter != service->extensions()->rend(); ++iter) {
+ for (ExtensionSet::const_iterator iter = service->extensions()->begin();
+ iter != service->extensions()->end(); ++iter) {
if ((*iter)->path() == extension_path) {
extension = *iter;
break;
@@ -296,8 +296,9 @@ const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
<< " num after: " << base::IntToString(num_after)
<< " Installed extensions follow:";
- for (size_t i = 0; i < service->extensions()->size(); ++i)
- VLOG(1) << " " << (*service->extensions())[i]->id();
+ for (ExtensionSet::const_iterator it = service->extensions()->begin();
+ it != service->extensions()->end(); ++it)
+ VLOG(1) << " " << (*it)->id();
VLOG(1) << "Errors follow:";
const std::vector<std::string>* errors =
« no previous file with comments | « chrome/browser/extensions/extension_apitest.cc ('k') | chrome/browser/extensions/extension_browsertests_misc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698