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

Issue 2442223002: Views: Give ScrollViewTest a test harness. (Closed)

Created:
4 years, 1 month ago by tapted
Modified:
4 years, 1 month ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Views: Give ScrollViewTest a test harness. Currently the tests are all TEST rather than TEST_F. Add a test harness (TEST_F) to reduce some boilerplate and encapsulate some subtle setup code required for overlay scrollers on Mac. Part of this is to do with ScopedPreferredScrollerStyle: Interleaving swizzlers like `std::unique_ptr x(new X1); x.reset(new X2);` causes incorrect behaviour and leakage of the swizzled methods across tests run in the same process. Specifically, X1's destructor restores the original methods, but then X2's destructor will restore X1's swizzled methods, since they were in effect when X2 was constructed. Make it harder for devs to shoot themselves in the foot with this. BUG=615948 Committed: https://crrev.com/5a1cee4f8acd9731b7af2c616b42aa892fdfdd2e Cr-Commit-Position: refs/heads/master@{#427253}

Patch Set 1 #

Total comments: 5

Patch Set 2 : respond to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -232 lines) Patch
M ui/base/test/scoped_preferred_scroller_style_mac.mm View 3 chunks +9 lines, -0 lines 0 comments Download
M ui/views/controls/scroll_view_unittest.cc View 1 7 chunks +232 lines, -232 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (15 generated)
tapted
Hi sky, please take a look. Thanks! https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc File ui/views/controls/scroll_view_unittest.cc (right): https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc#newcode158 ui/views/controls/scroll_view_unittest.cc:158: // change ...
4 years, 1 month ago (2016-10-24 06:50:51 UTC) #8
sky
LGTM https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc File ui/views/controls/scroll_view_unittest.cc (right): https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc#newcode151 ui/views/controls/scroll_view_unittest.cc:151: scroller_style_.reset(); It's worth a comment as to why ...
4 years, 1 month ago (2016-10-24 16:09:49 UTC) #9
tapted
https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc File ui/views/controls/scroll_view_unittest.cc (right): https://codereview.chromium.org/2442223002/diff/1/ui/views/controls/scroll_view_unittest.cc#newcode151 ui/views/controls/scroll_view_unittest.cc:151: scroller_style_.reset(); On 2016/10/24 16:09:49, sky wrote: > It's worth ...
4 years, 1 month ago (2016-10-25 02:44:12 UTC) #14
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/2442223002/20001
4 years, 1 month ago (2016-10-25 02:45:15 UTC) #17
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-10-25 02:49:39 UTC) #19
commit-bot: I haz the power
4 years, 1 month ago (2016-10-25 02:53:57 UTC) #21
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/5a1cee4f8acd9731b7af2c616b42aa892fdfdd2e
Cr-Commit-Position: refs/heads/master@{#427253}

Powered by Google App Engine
This is Rietveld 408576698