Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3156)

Unified Diff: ash/system/tray/system_tray_unittest.cc

Issue 10830190: Fix status area tray spacing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/status_area_widget_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « ash/system/status_area_widget_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698