DescriptionCompletely 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 #
Messages
Total messages: 10 (4 generated)
|