Skip to content

Commit

Permalink
[ios] Fix iOS WebView EG2 tests
Browse files Browse the repository at this point in the history
The iOS WebView shell don't create a CommandLine object which means
that creating a display::Screen object will cause a crash while it
is checking the flags passed on the command line.

As registering display::Screen observers require creating the object,
there is no need to assert there is no observer if no display::Screen
exists.

Bug: none
Change-Id: I47e573bb1a397a565315e114befe8f22004b4245
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3714591
Auto-Submit: Sylvain Defresne <[email protected]>
Commit-Queue: Mitsuru Oshima <[email protected]>
Reviewed-by: Mitsuru Oshima <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1016355}
  • Loading branch information
sdefresne authored and Chromium LUCI CQ committed Jun 21, 2022
1 parent 0bbec75 commit 49fb532
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ios/testing/earl_grey/base_earl_grey_test_case.mm
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ + (void)tearDown {
// The same screen object is shared across multiple test runs on IOS build.
// Make sure that all display observers are removed at the end of each
// test.
display::ScreenBase* screen =
static_cast<display::ScreenBase*>(display::Screen::GetScreen());
DCHECK(!screen->HasDisplayObservers());
if (display::Screen::HasScreen()) {
display::ScreenBase* screen =
static_cast<display::ScreenBase*>(display::Screen::GetScreen());
DCHECK(!screen->HasDisplayObservers());
}
#endif
if ([[AppLaunchManager sharedManager] appIsLaunched]) {
[CoverageUtils writeClangCoverageProfile];
Expand Down

0 comments on commit 49fb532

Please sign in to comment.