Chromium Code Reviews| 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..34a7dd38d519946c2fd79c1df457809f7192cc32 100644 |
| --- a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
| +++ b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm |
| @@ -98,13 +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) { |
|
sky
2016/08/04 16:34:38
no {}
|
| ret.emplace_back(entry); |
| - out->emplace_back(entry); |
| } |
| return ret; |
| } |
| @@ -127,10 +124,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 +236,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 +265,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"), |