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

Issue 2192253002: Refactor history menu tests for clearer setup (Closed)

Created:
4 years, 4 months ago by Sidney San Martín
Modified:
4 years, 4 months ago
Reviewers:
Robert Sesek
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor history menu tests for clearer setup In https://crrev.com/c2aa85e42d6d85b15e46e82f2df516e2e896bd1b, I had to fix a couple of test bugs including a wrong hard-coded array index. This switches initialization to a hopefully-less-error-prone form. BUG=633689 Committed: https://crrev.com/407f858ac218dc95d41e32d8752ec938b1d90ff3 Cr-Commit-Position: refs/heads/master@{#409331}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Smaller refactor #

Total comments: 4

Patch Set 3 : Fix ownership, include initializer_list #

Total comments: 8

Patch Set 4 : holdEntries -> hold_entries, l -> entries #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -47 lines) Patch
M chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm View 1 2 3 4 chunks +54 lines, -47 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (9 generated)
Sidney San Martín
https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm File chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm (right): https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode53 chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:53: class TestEntries { This class is longer/nastier than I ...
4 years, 4 months ago (2016-07-29 20:21:33 UTC) #2
Robert Sesek
These are mostly style comments. But I'm not sure if this is the right direction ...
4 years, 4 months ago (2016-07-29 21:37:26 UTC) #4
Sidney San Martín
On 2016/07/29 21:37:26, Robert Sesek wrote: > These are mostly style comments. But I'm not ...
4 years, 4 months ago (2016-07-29 22:02:17 UTC) #5
Sidney San Martín
https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm File chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm (right): https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode70 chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:70: Tab(SessionID::id_type id_, std::string url_, std::string title_) On 2016/07/29 21:37:25, ...
4 years, 4 months ago (2016-07-29 22:02:34 UTC) #6
Robert Sesek
https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm File chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm (right): https://codereview.chromium.org/2192253002/diff/1/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode70 chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:70: Tab(SessionID::id_type id_, std::string url_, std::string title_) On 2016/07/29 22:02:33, ...
4 years, 4 months ago (2016-08-02 14:39:25 UTC) #7
Sidney San Martín
I found myself back in this file and wanted to try a less convoluted change. ...
4 years, 4 months ago (2016-08-02 15:01:03 UTC) #9
Sidney San Martín
On 2016/08/02 14:39:25, Robert Sesek wrote: > I use a_var or an_var, indirect through the ...
4 years, 4 months ago (2016-08-02 15:01:47 UTC) #10
Robert Sesek
Yes, this is much more Chromium-style for unittest code. https://codereview.chromium.org/2192253002/diff/20001/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm File chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm (right): https://codereview.chromium.org/2192253002/diff/20001/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode8 chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:8: ...
4 years, 4 months ago (2016-08-02 15:06:28 UTC) #11
Sidney San Martín
The fix for ownership isn't great, but it should go away in another CL later ...
4 years, 4 months ago (2016-08-02 16:27:14 UTC) #13
Robert Sesek
https://codereview.chromium.org/2192253002/diff/60001/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm File chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm (right): https://codereview.chromium.org/2192253002/diff/60001/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode100 chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:100: MockTRS::Entries CreateSessionEntries( Rather than this being a "Create" function, ...
4 years, 4 months ago (2016-08-02 18:47:38 UTC) #14
Sidney San Martín
The catch with the memory management changes you suggested is that std::unique_ptr can't be passed ...
4 years, 4 months ago (2016-08-02 19:47:35 UTC) #16
Sidney San Martín
On 2016/08/02 18:47:38, Robert Sesek wrote: > https://codereview.chromium.org/2192253002/diff/60001/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm#newcode131 > chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm:131: > window->tabs.emplace_back(std::move(*tab)); > This line ...
4 years, 4 months ago (2016-08-02 20:11:44 UTC) #17
Robert Sesek
LGTM. With the follow-up CL that does get better.
4 years, 4 months ago (2016-08-02 20:44:05 UTC) #18
Robert Sesek
Did you want to set BUG= in the description?
4 years, 4 months ago (2016-08-02 20:44:30 UTC) #19
Sidney San Martín
On 2016/08/02 20:44:30, Robert Sesek wrote: > Did you want to set BUG= in the ...
4 years, 4 months ago (2016-08-02 20:45:55 UTC) #20
Robert Sesek
On 2016/08/02 20:45:55, Sidney San Martín wrote: > On 2016/08/02 20:44:30, Robert Sesek wrote: > ...
4 years, 4 months ago (2016-08-02 20:46:34 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2192253002/100001
4 years, 4 months ago (2016-08-02 20:47:55 UTC) #24
commit-bot: I haz the power
Committed patchset #4 (id:100001)
4 years, 4 months ago (2016-08-02 21:34:51 UTC) #26
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 21:36:49 UTC) #28
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/407f858ac218dc95d41e32d8752ec938b1d90ff3
Cr-Commit-Position: refs/heads/master@{#409331}

Powered by Google App Engine
This is Rietveld 408576698