Index: chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
index ec800d6f8b3df133b11cb061204c543913669d29..634d2339f6d188f734603a5c534f621b48a40c29 100644 |
--- a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
+++ b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
@@ -98,14 +98,10 @@ class HistoryMenuBridgeTest : public CocoaProfileTest { |
} |
MockTRS::Entries CreateSessionEntries( |
- std::vector<std::unique_ptr<MockTRS::Entry>>* out, |
std::initializer_list<MockTRS::Entry*> entries) { |
MockTRS::Entries ret; |
- out->reserve(out->size() + entries.size()); |
- for (auto* entry : entries) { |
+ for (auto* entry : entries) |
ret.emplace_back(entry); |
- out->emplace_back(entry); |
- } |
return ret; |
} |
@@ -127,10 +123,8 @@ class HistoryMenuBridgeTest : public CocoaProfileTest { |
auto window = new MockTRS::Window; |
window->id = id; |
window->tabs.reserve(tabs.size()); |
- for (auto* tab : tabs) { |
- window->tabs.emplace_back(std::move(*tab)); |
- delete tab; |
- } |
+ for (auto* tab : tabs) |
+ window->tabs.emplace_back(std::move(tab)); |
return window; |
} |
@@ -241,8 +235,7 @@ TEST_F(HistoryMenuBridgeTest, AddItemToMenu) { |
// Test that the menu is created for a set of simple tabs. |
TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabs) { |
std::unique_ptr<MockTRS> trs(new MockTRS(profile())); |
- std::vector<std::unique_ptr<MockTRS::Entry>> hold_entries; |
- auto entries{CreateSessionEntries(&hold_entries, { |
+ auto entries{CreateSessionEntries({ |
CreateSessionTab(24, "http://google.com", "Google"), |
CreateSessionTab(42, "http://apple.com", "Apple"), |
})}; |
@@ -271,8 +264,7 @@ TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabs) { |
// Test that the menu is created for a mix of windows and tabs. |
TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabsAndWindows) { |
std::unique_ptr<MockTRS> trs(new MockTRS(profile())); |
- std::vector<std::unique_ptr<MockTRS::Entry>> hold_entries; |
- auto entries{CreateSessionEntries(&hold_entries, { |
+ auto entries{CreateSessionEntries({ |
CreateSessionTab(24, "http://google.com", "Google"), |
CreateSessionWindow(30, { |
CreateSessionTab(31, "http://foo.com", "foo"), |