| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/chromeos/tray_display.h" | 5 #include "ash/system/chromeos/tray_display.h" |
| 6 | 6 |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
| 12 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
| 13 #include "ash/test/display_manager_test_api.h" |
| 13 #include "ash/test/test_system_tray_delegate.h" | 14 #include "ash/test/test_system_tray_delegate.h" |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "grit/ash_strings.h" | 18 #include "grit/ash_strings.h" |
| 18 #include "ui/accessibility/ax_view_state.h" | 19 #include "ui/accessibility/ax_view_state.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/gfx/display.h" | 21 #include "ui/gfx/display.h" |
| 21 #include "ui/message_center/message_center.h" | 22 #include "ui/message_center/message_center.h" |
| 22 #include "ui/message_center/notification.h" | 23 #include "ui/message_center/notification.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 EXPECT_TRUE(IsDisplayVisibleInTray()); | 307 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 307 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED); | 308 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED); |
| 308 EXPECT_EQ(expected, GetTrayDisplayText()); | 309 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 309 EXPECT_EQ( | 310 EXPECT_EQ( |
| 310 GetTooltipText( | 311 GetTooltipText( |
| 311 expected, GetFirstDisplayName(), "600x600", base::string16(), ""), | 312 expected, GetFirstDisplayName(), "600x600", base::string16(), ""), |
| 312 GetTrayDisplayTooltipText()); | 313 GetTrayDisplayTooltipText()); |
| 313 CheckAccessibleName(); | 314 CheckAccessibleName(); |
| 314 | 315 |
| 315 // Unified mode | 316 // Unified mode |
| 317 test::DisplayManagerTestApi::EnableUnifiedDesktopForTest(); |
| 316 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); | 318 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED); |
| 317 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); | 319 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); |
| 318 UpdateDisplay("300x200,400x500"); | 320 UpdateDisplay("300x200,400x500"); |
| 319 // Update the cache variables as the primary root window changed. | 321 // Update the cache variables as the primary root window changed. |
| 320 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 322 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 321 EXPECT_TRUE(IsDisplayVisibleInTray()); | 323 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 322 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_UNIFIED); | 324 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_UNIFIED); |
| 323 EXPECT_EQ(expected, GetTrayDisplayText()); | 325 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 324 } | 326 } |
| 325 | 327 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 // rotate the second. | 589 // rotate the second. |
| 588 UpdateDisplay("400x400,200x200/r"); | 590 UpdateDisplay("400x400,200x200/r"); |
| 589 EXPECT_EQ(l10n_util::GetStringFUTF16( | 591 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 590 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetSecondDisplayName(), | 592 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetSecondDisplayName(), |
| 591 l10n_util::GetStringUTF16( | 593 l10n_util::GetStringUTF16( |
| 592 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), | 594 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), |
| 593 GetDisplayNotificationAdditionalText()); | 595 GetDisplayNotificationAdditionalText()); |
| 594 } | 596 } |
| 595 | 597 |
| 596 } // namespace ash | 598 } // namespace ash |
| OLD | NEW |