Ensure all tests run with a valid ScrollbarTheme
In https://crrev.com/c/2119933 I added a new call to GetScrollbarTheme which caused a number of unit tests to start crashing. On Android, unit tests run without a ThemeEngine (Platform::Current()->ThemeEngine() == nullptr). This means that they must use a mock scrollbar theme, otherwise anything scrollbar related might crash. Currently, it was possible for some tests to avoid setting a mock theme and run successfully if they got lucky and avoided code paths that called into the theme. This CL adds a DCHECK when a blink::Page is created to ensure we can access the theme. This flushed out all tests that were in this situation and we fix them here. It also ensures future tests are made to install a mock theme so we don't run into this situation again. Bug: 1039501 Change-Id: I78dbf406b6168a71b67e75f09ef824b5cdc2a8d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2125952Reviewed-by:Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by:
Mounir Lamouri <mlamouri@chromium.org> Reviewed-by:
Philip Rogers <pdr@chromium.org> Reviewed-by:
Dale Curtis <dalecurtis@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#754800}
Showing
Please register or sign in to comment