Commit 38a0fc57 authored by Andrew Xu's avatar Andrew Xu Committed by Commit Bot

Fix broken shelf layout manager tests

In ShelfLayoutManagerTest::ShelfUpdatedWhenStatusAreaChangesSize,
it assumes that the shelf view fills the display space. It will be
incorrect under new specs. In ShelfLayoutManagerTest::RtlPlacement,
the test fails to reset the RTL setting. This CL fixes these two tests.

Bug: 1002576
Change-Id: I9dc2a82f5dab18c33e6947e21112af5aa4913f0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796118
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695259}
parent ec9945ae
...@@ -1073,8 +1073,11 @@ TEST_F(ShelfLayoutManagerTest, ShelfUpdatedWhenStatusAreaChangesSize) { ...@@ -1073,8 +1073,11 @@ TEST_F(ShelfLayoutManagerTest, ShelfUpdatedWhenStatusAreaChangesSize) {
.width(); .width();
const int nav_width = const int nav_width =
shelf_widget->navigation_widget()->GetWindowBoundsInScreen().width(); shelf_widget->navigation_widget()->GetWindowBoundsInScreen().width();
const int hotseat_width = const int hotseat_width = GetPrimaryShelf()
GetPrimaryShelf()->GetShelfViewForTesting()->width(); ->shelf_widget()
->hotseat_widget()
->GetWindowBoundsInScreen()
.width();
const int margins = ShelfConfig::Get()->home_button_edge_spacing() + const int margins = ShelfConfig::Get()->home_button_edge_spacing() +
ShelfConfig::Get()->app_icon_group_margin(); ShelfConfig::Get()->app_icon_group_margin();
EXPECT_EQ(200, total_width - nav_width - hotseat_width - margins); EXPECT_EQ(200, total_width - nav_width - hotseat_width - margins);
...@@ -3095,10 +3098,15 @@ TEST_F(ShelfLayoutManagerTest, RtlPlacement) { ...@@ -3095,10 +3098,15 @@ TEST_F(ShelfLayoutManagerTest, RtlPlacement) {
rtl_right_position); rtl_right_position);
}; };
const std::string locale = base::i18n::GetConfiguredLocale();
ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget(); ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget();
check_mirrored_placement(shelf_widget->navigation_widget()); check_mirrored_placement(shelf_widget->navigation_widget());
check_mirrored_placement(shelf_widget->status_area_widget()); check_mirrored_placement(shelf_widget->status_area_widget());
check_mirrored_placement(shelf_widget); check_mirrored_placement(shelf_widget);
// Reset the lauguage setting.
base::i18n::SetICUDefaultLocale(locale);
} }
class ShelfLayoutManagerKeyboardTest : public AshTestBase { class ShelfLayoutManagerKeyboardTest : public AshTestBase {
......
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