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

Unified Diff: chrome/browser/ui/website_settings/website_settings_unittest.cc

Issue 10837049: Fix memory leak in WebsiteSettingsTest.ShowInfoBar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 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 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/ui/website_settings/website_settings_unittest.cc
diff --git a/chrome/browser/ui/website_settings/website_settings_unittest.cc b/chrome/browser/ui/website_settings/website_settings_unittest.cc
index c1649f10629c6632a6b6c57a463237e98c74c007..bee935d4fff062173f674a36e83646ccba35499f 100644
--- a/chrome/browser/ui/website_settings/website_settings_unittest.cc
+++ b/chrome/browser/ui/website_settings/website_settings_unittest.cc
@@ -10,6 +10,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
+#include "chrome/browser/infobars/infobar_delegate.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/website_settings/website_settings_ui.h"
#include "chrome/common/content_settings.h"
@@ -341,6 +342,7 @@ TEST_F(WebsiteSettingsTest, ShowInfoBar) {
website_settings()->OnUIClosing();
EXPECT_EQ(1u, infobar_tab_helper()->infobar_count());
- infobar_tab_helper()->RemoveInfoBar(
- infobar_tab_helper()->GetInfoBarDelegateAt(0));
+ InfoBarDelegate* delegate = infobar_tab_helper()->GetInfoBarDelegateAt(0);
Timur Iskhodzhanov 2012/08/02 11:18:09 is there anything like auto_ptr/scoped_ptr which i
markusheintz_ 2012/08/02 12:55:38 I guess you are right it's probably better to use
+ infobar_tab_helper()->RemoveInfoBar(delegate);
+ delete delegate;
}
« 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