Chromium Code Reviews| Index: ash/system/chromeos/tray_display_unittest.cc |
| diff --git a/ash/system/chromeos/tray_display_unittest.cc b/ash/system/chromeos/tray_display_unittest.cc |
| index fe761f4577b9eb056c48c2ced65c6409d8c3d21e..d37b09f06603a21544f24653d8a00332fd6ded57 100644 |
| --- a/ash/system/chromeos/tray_display_unittest.cc |
| +++ b/ash/system/chromeos/tray_display_unittest.cc |
| @@ -81,6 +81,7 @@ class TrayDisplayTest : public ash::test::AshTestBase { |
| protected: |
| SystemTray* tray() { return tray_; } |
| TrayDisplay* tray_display() { return tray_display_; } |
| + void UpdateTray(); |
| void CloseNotification(); |
| bool IsDisplayVisibleInTray() const; |
| @@ -110,6 +111,10 @@ TrayDisplayTest::~TrayDisplayTest() { |
| void TrayDisplayTest::SetUp() { |
| ash::test::AshTestBase::SetUp(); |
| + UpdateTray(); |
| +} |
| + |
| +void TrayDisplayTest::UpdateTray() { |
| tray_ = Shell::GetPrimaryRootWindowController()->GetSystemTray(); |
| tray_display_ = new TrayDisplay(tray_); |
| tray_->AddTrayItem(tray_display_); |
| @@ -291,6 +296,17 @@ TEST_F(TrayDisplayTest, InternalDisplayResized) { |
| expected, GetFirstDisplayName(), "600x600", base::string16(), ""), |
| GetTrayDisplayTooltipText()); |
| CheckAccessibleName(); |
| + |
| + // Unified mode |
| + display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); |
| + display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); |
| + UpdateDisplay("300x200,400x500"); |
| + // Update the cache variables as the primary root window changed. |
| + UpdateTray(); |
|
Jun Mukai
2015/05/13 18:03:49
Resetting the variable explicitly from a test case
|
| + tray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| + EXPECT_TRUE(IsDisplayVisibleInTray()); |
| + expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_UNIFIED); |
| + EXPECT_EQ(expected, GetTrayDisplayText()); |
| } |
| TEST_F(TrayDisplayTest, ExternalDisplayResized) { |