| Index: ash/system/tray/system_tray_unittest.cc
|
| diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc
|
| index 6577a784b452faea7a5476d65b378f7cd05e8761..b03c548a14ff0f405661e05fafa812349dd31fc6 100644
|
| --- a/ash/system/tray/system_tray_unittest.cc
|
| +++ b/ash/system/tray/system_tray_unittest.cc
|
| @@ -138,23 +138,27 @@ TEST_F(SystemTrayTest, TrayWidgetAutoResizes) {
|
| SystemTray* tray = GetSystemTray();
|
| ASSERT_TRUE(tray->GetWidget());
|
|
|
| - gfx::Size widget_size = tray->GetWidget()->GetWindowBoundsInScreen().size();
|
| + // Add an initial tray item so that the tray gets laid out correctly.
|
| + TestItem* initial_item = new TestItem;
|
| + tray->AddTrayItem(initial_item);
|
|
|
| - TestItem* test_item = new TestItem;
|
| - tray->AddTrayItem(test_item);
|
| + gfx::Size initial_size = tray->GetWidget()->GetWindowBoundsInScreen().size();
|
| +
|
| + TestItem* new_item = new TestItem;
|
| + tray->AddTrayItem(new_item);
|
|
|
| gfx::Size new_size = tray->GetWidget()->GetWindowBoundsInScreen().size();
|
|
|
| // Adding the new item should change the size of the tray.
|
| - EXPECT_NE(widget_size.ToString(), new_size.ToString());
|
| + EXPECT_NE(initial_size.ToString(), new_size.ToString());
|
|
|
| // Hiding the tray view of the new item should also change the size of the
|
| // tray.
|
| - test_item->tray_view()->SetVisible(false);
|
| - EXPECT_EQ(widget_size.ToString(),
|
| + new_item->tray_view()->SetVisible(false);
|
| + EXPECT_EQ(initial_size.ToString(),
|
| tray->GetWidget()->GetWindowBoundsInScreen().size().ToString());
|
|
|
| - test_item->tray_view()->SetVisible(true);
|
| + new_item->tray_view()->SetVisible(true);
|
| EXPECT_EQ(new_size.ToString(),
|
| tray->GetWidget()->GetWindowBoundsInScreen().size().ToString());
|
| }
|
|
|