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

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

Issue 2808027: Fix a unit test leak.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_menu_manager_unittest.cc
===================================================================
--- chrome/browser/extensions/extension_menu_manager_unittest.cc (revision 50869)
+++ chrome/browser/extensions/extension_menu_manager_unittest.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/json/json_reader.h"
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
+#include "base/scoped_vector.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_menu_manager.h"
#include "chrome/browser/extensions/extension_message_service.h"
@@ -43,11 +44,14 @@
// Creates and returns a test Extension. The caller does *not* own the return
// value.
Extension* AddExtension(std::string name) {
- return prefs_.AddExtension(name);
+ Extension* extension = prefs_.AddExtension(name);
+ extensions_.push_back(extension);
+ return extension;
}
protected:
ExtensionMenuManager manager_;
+ ScopedVector<Extension> extensions_;
TestExtensionPrefs prefs_;
private:
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698