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

Issue 1643453002: Completely rewrite OpaqueBrowserFrameViewLayout unittests. (Closed)

Created:
4 years, 11 months ago by Peter Kasting
Modified:
4 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Completely rewrite OpaqueBrowserFrameViewLayout unittests. The old tests simply hardcoded various size strings. This was brittle against changes, and did not work correctly in material design. The new tests basically compute the important aspects of various bounds, without simply calling into the real OBFVL positioning functions (which would make the tests vacuous). These are sufficiently parameterized to handle not only material design but a variety of other state changes (maximized vs. restored, hidden caption buttons, caption buttons on left, etc.). This unfortunately results in fairly complicated math, but frame positioning is complex, so there's not much for it. Many of these states were tested in sort of a one-off fashion, but the tests have now been expanded to run a significantly more complete set of tests, in particular testing just about everything in both restored and maximized mode. As part of this rewrite, the tests now make use of some of the constants from opaque_browser_frame_view_layout.cc, which have been exposed in the header for this purpose. Along the way, some of these were simplified a bit when we had several constants that had the same value and served similar purposes. BUG=575257 TEST=Unittests pass even with --top-chrome-md=material[-hybrid] Committed: https://crrev.com/48ae591062e4c764d6f064e93956d1ae1a0e88fa Cr-Commit-Position: refs/heads/master@{#371975}

Patch Set 1 #

Patch Set 2 : Rewrite #

Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -260 lines) Patch
M chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc View 7 chunks +42 lines, -54 lines 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc View 1 7 chunks +251 lines, -206 lines 0 comments Download

Messages

Total messages: 10 (4 generated)
Peter Kasting
The test code is a bit impenetrable... sorry :(
4 years, 11 months ago (2016-01-27 08:30:27 UTC) #2
sky
Rubber stamp LGTM - I would add that the way you have written this code ...
4 years, 11 months ago (2016-01-27 17:58:20 UTC) #3
Peter Kasting
Adding tracing to indicate if windows are restored or maximized. Shortened EXPECT_ statements so failure ...
4 years, 10 months ago (2016-01-28 02:02:25 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1643453002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1643453002/20001
4 years, 10 months ago (2016-01-28 02:08:03 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 10 months ago (2016-01-28 02:55:06 UTC) #8
commit-bot: I haz the power
4 years, 10 months ago (2016-01-28 02:55:55 UTC) #10
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/48ae591062e4c764d6f064e93956d1ae1a0e88fa
Cr-Commit-Position: refs/heads/master@{#371975}

Powered by Google App Engine
This is Rietveld 408576698