Commit f119c7fa authored by John Pham's avatar John Pham Committed by Commit Bot

Explicitly layout child views to get their bounds set correctly in test

The unexpected behavior sanitizer picked up an issue in ToolbarAccountIconContainerViewBrowserTest.ShouldUpdateHighlightInNormalWindow where |save_card_icon| was reporting an incorrect size.

The problem is that |save_card_icon| was reporting it's bounds as (0, 0). This was happening on both Linux and Windows.

The size would then be used as a divisor. Floating point division-by-zero behavior isn't defined in the C/C++ spec and it's up to the compiler implementation. Windows (clang) will return NaN while Linux (gcc/g++) will raise an exception.

The fix is to have the parent view, |container| reapply the layout after setting |save_card_icon| to visible. This will set the bounds of |save_card_info| correctly.

Change-Id: I51796979292c0a65d40a28aeb5a255a80acae510
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2110396Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Commit-Queue: John Pham <johnp@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#752086}
parent 13194fbc
......@@ -64,6 +64,7 @@ class ToolbarAccountIconContainerViewBrowserTest : public InProcessBrowserTest {
container->page_action_icon_controller()->GetIconView(
PageActionIconType::kSaveCard);
save_card_icon->SetVisible(true);
container->Layout();
EXPECT_EQ(container->uses_highlight(), expect_highlight);
EXPECT_FALSE(IsHighlighted(container));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment