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

Unified Diff: chrome/browser/sessions/tab_restore_service_browsertest.cc

Issue 10826077: Valgrind: Fix leak in TabRestoreServiceTest.PruneEntries. (Closed) Base URL: svn://chrome-svn/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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_restore_service_browsertest.cc
===================================================================
--- chrome/browser/sessions/tab_restore_service_browsertest.cc (revision 148864)
+++ chrome/browser/sessions/tab_restore_service_browsertest.cc (working copy)
@@ -116,7 +116,7 @@
session_service->SetSelectedTabInWindow(window_id, 0);
if (pinned)
session_service->SetPinnedState(window_id, tab_id, true);
- scoped_ptr<NavigationEntry> entry(NavigationEntry::Create());;
+ scoped_ptr<NavigationEntry> entry(NavigationEntry::Create());
entry->SetURL(url1_);
session_service->UpdateTabNavigation(window_id, tab_id, 0, *entry.get());
}
@@ -289,9 +289,8 @@
const Window* restored_window =
static_cast<const Window*>(restored_entry);
EXPECT_EQ(app_name, restored_window->app_name);
-
}
-#endif
+#endif // defined(USE_AURA)
// Make sure we persist entries to disk that have post data.
TEST_F(TabRestoreServiceTest, DontPersistPostData) {
@@ -573,7 +572,8 @@
// Prune older first.
TabNavigation navigation;
- navigation.set_virtual_url(GURL("http://recent"));
+ const char kRecentUrl[] = "http://recent";
+ navigation.set_virtual_url(GURL(kRecentUrl));
navigation.set_title(ASCIIToUTF16("Most recent"));
Tab* tab = new Tab();
tab->navigations.push_back(navigation);
@@ -582,7 +582,7 @@
EXPECT_EQ(max_entries + 1, service_->entries_.size());
service_->PruneEntries();
EXPECT_EQ(max_entries, service_->entries_.size());
- EXPECT_EQ(GURL("http://recent"),
+ EXPECT_EQ(GURL(kRecentUrl),
static_cast<Tab*>(service_->entries_.front())->
navigations[0].virtual_url());
@@ -598,7 +598,7 @@
EXPECT_EQ(max_entries + 1, service_->entries_.size());
service_->PruneEntries();
EXPECT_EQ(max_entries, service_->entries_.size());
- EXPECT_EQ(GURL("http://recent"),
+ EXPECT_EQ(GURL(kRecentUrl),
static_cast<Tab*>(service_->entries_.front())->
navigations[0].virtual_url());
@@ -617,6 +617,7 @@
// Don't prune NTPs that have multiple navigations.
// (Erase the last NTP first.)
+ delete service_->entries_.front();
service_->entries_.erase(service_->entries_.begin());
tab = new Tab();
tab->current_navigation_index = 1;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698