• tapted's avatar
    Views: Give ScrollViewTest a test harness. · 5a1cee4f
    tapted authored
    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
    
    Review-Url: https://codereview.chromium.org/2442223002
    Cr-Commit-Position: refs/heads/master@{#427253}
    5a1cee4f
scroll_view_unittest.cc 34.3 KB