| 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/chromeos/devicetype_utils.h" | 11 #include "ash/system/chromeos/devicetype_utils.h" |
| 12 #include "ash/system/tray/system_tray.h" | 12 #include "ash/system/tray/system_tray.h" |
| 13 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 14 #include "ash/test/display_manager_test_api.h" | 14 #include "ash/test/display_manager_test_api.h" |
| 15 #include "ash/test/test_system_tray_delegate.h" | 15 #include "ash/test/test_system_tray_delegate.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "grit/ash_strings.h" | 19 #include "grit/ash_strings.h" |
| 20 #include "ui/accessibility/ax_view_state.h" | 20 #include "ui/accessibility/ax_view_state.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/gfx/display.h" | 22 #include "ui/display/display.h" |
| 23 #include "ui/message_center/message_center.h" | 23 #include "ui/message_center/message_center.h" |
| 24 #include "ui/message_center/notification.h" | 24 #include "ui/message_center/notification.h" |
| 25 #include "ui/message_center/notification_list.h" | 25 #include "ui/message_center/notification_list.h" |
| 26 #include "ui/views/controls/label.h" | 26 #include "ui/views/controls/label.h" |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 | 29 |
| 30 base::string16 GetTooltipText(const base::string16& headline, | 30 base::string16 GetTooltipText(const base::string16& headline, |
| 31 const base::string16& name1, | 31 const base::string16& name1, |
| 32 const std::string& data1, | 32 const std::string& data1, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING_NO_INTERNAL); | 220 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING_NO_INTERNAL); |
| 221 EXPECT_EQ(expected, GetTrayDisplayText()); | 221 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 222 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), | 222 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), |
| 223 GetTrayDisplayTooltipText()); | 223 GetTrayDisplayTooltipText()); |
| 224 CheckAccessibleName(); | 224 CheckAccessibleName(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 TEST_F(TrayDisplayTest, InternalDisplay) { | 227 TEST_F(TrayDisplayTest, InternalDisplay) { |
| 228 UpdateDisplay("400x400"); | 228 UpdateDisplay("400x400"); |
| 229 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 229 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 230 gfx::Display::SetInternalDisplayId(display_manager->first_display_id()); | 230 display::Display::SetInternalDisplayId(display_manager->first_display_id()); |
| 231 | 231 |
| 232 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 232 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 233 EXPECT_FALSE(IsDisplayVisibleInTray()); | 233 EXPECT_FALSE(IsDisplayVisibleInTray()); |
| 234 | 234 |
| 235 // Extended | 235 // Extended |
| 236 UpdateDisplay("400x400,200x200"); | 236 UpdateDisplay("400x400,200x200"); |
| 237 base::string16 expected = l10n_util::GetStringFUTF16( | 237 base::string16 expected = l10n_util::GetStringFUTF16( |
| 238 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, GetSecondDisplayName()); | 238 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, GetSecondDisplayName()); |
| 239 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 239 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 240 EXPECT_TRUE(IsDisplayVisibleInTray()); | 240 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 254 GetMirroringDisplayName()); | 254 GetMirroringDisplayName()); |
| 255 EXPECT_EQ(expected, GetTrayDisplayText()); | 255 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 256 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), | 256 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), |
| 257 GetTrayDisplayTooltipText()); | 257 GetTrayDisplayTooltipText()); |
| 258 CheckAccessibleName(); | 258 CheckAccessibleName(); |
| 259 } | 259 } |
| 260 | 260 |
| 261 TEST_F(TrayDisplayTest, InternalDisplayResized) { | 261 TEST_F(TrayDisplayTest, InternalDisplayResized) { |
| 262 UpdateDisplay("400x400@1.5"); | 262 UpdateDisplay("400x400@1.5"); |
| 263 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 263 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 264 gfx::Display::SetInternalDisplayId(display_manager->first_display_id()); | 264 display::Display::SetInternalDisplayId(display_manager->first_display_id()); |
| 265 | 265 |
| 266 // Shows the tray_display even though there's a single-display. | 266 // Shows the tray_display even though there's a single-display. |
| 267 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 267 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 268 EXPECT_TRUE(IsDisplayVisibleInTray()); | 268 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 269 base::string16 internal_info = l10n_util::GetStringFUTF16( | 269 base::string16 internal_info = l10n_util::GetStringFUTF16( |
| 270 IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, | 270 IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, |
| 271 GetFirstDisplayName(), base::UTF8ToUTF16("600x600")); | 271 GetFirstDisplayName(), base::UTF8ToUTF16("600x600")); |
| 272 EXPECT_EQ(internal_info, GetTrayDisplayText()); | 272 EXPECT_EQ(internal_info, GetTrayDisplayText()); |
| 273 EXPECT_EQ(GetTooltipText(base::string16(), GetFirstDisplayName(), "600x600", | 273 EXPECT_EQ(GetTooltipText(base::string16(), GetFirstDisplayName(), "600x600", |
| 274 base::string16(), std::string()), | 274 base::string16(), std::string()), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 295 expected = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING, | 295 expected = l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING, |
| 296 GetMirroringDisplayName()); | 296 GetMirroringDisplayName()); |
| 297 EXPECT_EQ(expected, GetTrayDisplayText()); | 297 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 298 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "600x600"), | 298 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "600x600"), |
| 299 GetTrayDisplayTooltipText()); | 299 GetTrayDisplayTooltipText()); |
| 300 CheckAccessibleName(); | 300 CheckAccessibleName(); |
| 301 | 301 |
| 302 // Closed lid mode. | 302 // Closed lid mode. |
| 303 display_manager->SetSoftwareMirroring(false); | 303 display_manager->SetSoftwareMirroring(false); |
| 304 UpdateDisplay("400x400@1.5,200x200"); | 304 UpdateDisplay("400x400@1.5,200x200"); |
| 305 gfx::Display::SetInternalDisplayId(ScreenUtil::GetSecondaryDisplay().id()); | 305 display::Display::SetInternalDisplayId( |
| 306 ScreenUtil::GetSecondaryDisplay().id()); |
| 306 UpdateDisplay("400x400@1.5"); | 307 UpdateDisplay("400x400@1.5"); |
| 307 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 308 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 308 EXPECT_TRUE(IsDisplayVisibleInTray()); | 309 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 309 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED); | 310 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED); |
| 310 EXPECT_EQ(expected, GetTrayDisplayText()); | 311 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 311 EXPECT_EQ( | 312 EXPECT_EQ( |
| 312 GetTooltipText( | 313 GetTooltipText( |
| 313 expected, GetFirstDisplayName(), "600x600", base::string16(), ""), | 314 expected, GetFirstDisplayName(), "600x600", base::string16(), ""), |
| 314 GetTrayDisplayTooltipText()); | 315 GetTrayDisplayTooltipText()); |
| 315 CheckAccessibleName(); | 316 CheckAccessibleName(); |
| 316 | 317 |
| 317 // Unified mode | 318 // Unified mode |
| 318 display_manager->SetUnifiedDesktopEnabled(true); | 319 display_manager->SetUnifiedDesktopEnabled(true); |
| 319 UpdateDisplay("300x200,400x500"); | 320 UpdateDisplay("300x200,400x500"); |
| 320 // Update the cache variables as the primary root window changed. | 321 // Update the cache variables as the primary root window changed. |
| 321 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 322 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 322 EXPECT_TRUE(IsDisplayVisibleInTray()); | 323 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 323 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_UNIFIED); | 324 expected = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_UNIFIED); |
| 324 EXPECT_EQ(expected, GetTrayDisplayText()); | 325 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 325 } | 326 } |
| 326 | 327 |
| 327 TEST_F(TrayDisplayTest, ExternalDisplayResized) { | 328 TEST_F(TrayDisplayTest, ExternalDisplayResized) { |
| 328 UpdateDisplay("400x400"); | 329 UpdateDisplay("400x400"); |
| 329 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 330 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 330 gfx::Display::SetInternalDisplayId(display_manager->first_display_id()); | 331 display::Display::SetInternalDisplayId(display_manager->first_display_id()); |
| 331 | 332 |
| 332 // Shows the tray_display even though there's a single-display. | 333 // Shows the tray_display even though there's a single-display. |
| 333 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 334 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 334 EXPECT_FALSE(IsDisplayVisibleInTray()); | 335 EXPECT_FALSE(IsDisplayVisibleInTray()); |
| 335 | 336 |
| 336 // Extended | 337 // Extended |
| 337 UpdateDisplay("400x400,200x200@1.5"); | 338 UpdateDisplay("400x400,200x200@1.5"); |
| 338 const gfx::Display& secondary_display = ScreenUtil::GetSecondaryDisplay(); | 339 const display::Display& secondary_display = ScreenUtil::GetSecondaryDisplay(); |
| 339 | 340 |
| 340 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 341 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 341 EXPECT_TRUE(IsDisplayVisibleInTray()); | 342 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 342 base::string16 expected = l10n_util::GetStringFUTF16( | 343 base::string16 expected = l10n_util::GetStringFUTF16( |
| 343 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, | 344 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, |
| 344 l10n_util::GetStringFUTF16( | 345 l10n_util::GetStringFUTF16( |
| 345 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATED_NAME, | 346 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATED_NAME, |
| 346 GetSecondDisplayName(), | 347 GetSecondDisplayName(), |
| 347 base::UTF8ToUTF16(secondary_display.size().ToString()))); | 348 base::UTF8ToUTF16(secondary_display.size().ToString()))); |
| 348 EXPECT_EQ(expected, GetTrayDisplayText()); | 349 EXPECT_EQ(expected, GetTrayDisplayText()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 360 GetMirroringDisplayName()); | 361 GetMirroringDisplayName()); |
| 361 EXPECT_EQ(expected, GetTrayDisplayText()); | 362 EXPECT_EQ(expected, GetTrayDisplayText()); |
| 362 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), | 363 EXPECT_EQ(GetMirroredTooltipText(expected, GetFirstDisplayName(), "400x400"), |
| 363 GetTrayDisplayTooltipText()); | 364 GetTrayDisplayTooltipText()); |
| 364 CheckAccessibleName(); | 365 CheckAccessibleName(); |
| 365 } | 366 } |
| 366 | 367 |
| 367 TEST_F(TrayDisplayTest, OverscanDisplay) { | 368 TEST_F(TrayDisplayTest, OverscanDisplay) { |
| 368 UpdateDisplay("400x400,300x300/o"); | 369 UpdateDisplay("400x400,300x300/o"); |
| 369 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 370 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 370 gfx::Display::SetInternalDisplayId(display_manager->first_display_id()); | 371 display::Display::SetInternalDisplayId(display_manager->first_display_id()); |
| 371 | 372 |
| 372 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 373 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 373 EXPECT_TRUE(IsDisplayVisibleInTray()); | 374 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 374 | 375 |
| 375 // /o creates the default overscan, and if overscan is set, the annotation | 376 // /o creates the default overscan, and if overscan is set, the annotation |
| 376 // should be the size. | 377 // should be the size. |
| 377 base::string16 overscan = l10n_util::GetStringUTF16( | 378 base::string16 overscan = l10n_util::GetStringUTF16( |
| 378 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION_OVERSCAN); | 379 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION_OVERSCAN); |
| 379 base::string16 headline = l10n_util::GetStringFUTF16( | 380 base::string16 headline = l10n_util::GetStringFUTF16( |
| 380 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, | 381 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 } | 443 } |
| 443 | 444 |
| 444 TEST_F(TrayDisplayTest, DisplayNotifications) { | 445 TEST_F(TrayDisplayTest, DisplayNotifications) { |
| 445 test::TestSystemTrayDelegate* tray_delegate = | 446 test::TestSystemTrayDelegate* tray_delegate = |
| 446 static_cast<test::TestSystemTrayDelegate*>( | 447 static_cast<test::TestSystemTrayDelegate*>( |
| 447 Shell::GetInstance()->system_tray_delegate()); | 448 Shell::GetInstance()->system_tray_delegate()); |
| 448 tray_delegate->set_should_show_display_notification(true); | 449 tray_delegate->set_should_show_display_notification(true); |
| 449 | 450 |
| 450 UpdateDisplay("400x400"); | 451 UpdateDisplay("400x400"); |
| 451 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 452 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 452 gfx::Display::SetInternalDisplayId(display_manager->first_display_id()); | 453 display::Display::SetInternalDisplayId(display_manager->first_display_id()); |
| 453 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 454 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 454 | 455 |
| 455 // rotation. | 456 // rotation. |
| 456 UpdateDisplay("400x400/r"); | 457 UpdateDisplay("400x400/r"); |
| 457 EXPECT_EQ(l10n_util::GetStringFUTF16( | 458 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 458 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), | 459 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
| 459 l10n_util::GetStringUTF16( | 460 l10n_util::GetStringUTF16( |
| 460 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), | 461 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), |
| 461 GetDisplayNotificationAdditionalText()); | 462 GetDisplayNotificationAdditionalText()); |
| 462 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 463 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 UpdateDisplay("400x400@1.5,200x200/r"); | 535 UpdateDisplay("400x400@1.5,200x200/r"); |
| 535 EXPECT_EQ(l10n_util::GetStringFUTF16( | 536 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 536 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetSecondDisplayName(), | 537 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetSecondDisplayName(), |
| 537 l10n_util::GetStringUTF16( | 538 l10n_util::GetStringUTF16( |
| 538 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), | 539 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), |
| 539 GetDisplayNotificationAdditionalText()); | 540 GetDisplayNotificationAdditionalText()); |
| 540 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 541 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 541 | 542 |
| 542 // Enters closed lid mode. | 543 // Enters closed lid mode. |
| 543 UpdateDisplay("400x400@1.5,200x200"); | 544 UpdateDisplay("400x400@1.5,200x200"); |
| 544 gfx::Display::SetInternalDisplayId(ScreenUtil::GetSecondaryDisplay().id()); | 545 display::Display::SetInternalDisplayId( |
| 546 ScreenUtil::GetSecondaryDisplay().id()); |
| 545 UpdateDisplay("400x400@1.5"); | 547 UpdateDisplay("400x400@1.5"); |
| 546 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED), | 548 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED), |
| 547 GetDisplayNotificationText()); | 549 GetDisplayNotificationText()); |
| 548 EXPECT_EQ( | 550 EXPECT_EQ( |
| 549 ash::SubstituteChromeOSDeviceType( | 551 ash::SubstituteChromeOSDeviceType( |
| 550 IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED_DESCRIPTION), | 552 IDS_ASH_STATUS_TRAY_DISPLAY_DOCKED_DESCRIPTION), |
| 551 GetDisplayNotificationAdditionalText()); | 553 GetDisplayNotificationAdditionalText()); |
| 552 } | 554 } |
| 553 | 555 |
| 554 TEST_F(TrayDisplayTest, DisplayConfigurationChangedTwice) { | 556 TEST_F(TrayDisplayTest, DisplayConfigurationChangedTwice) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), | 596 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)), |
| 595 GetDisplayNotificationAdditionalText()); | 597 GetDisplayNotificationAdditionalText()); |
| 596 } | 598 } |
| 597 | 599 |
| 598 // Tests that when the only change is rotation, that it is only displayed when | 600 // Tests that when the only change is rotation, that it is only displayed when |
| 599 // caused by user changes, and not by accelerometers. | 601 // caused by user changes, and not by accelerometers. |
| 600 TEST_F(TrayDisplayTest, RotationOnInternalDisplay) { | 602 TEST_F(TrayDisplayTest, RotationOnInternalDisplay) { |
| 601 UpdateDisplay("400x400"); | 603 UpdateDisplay("400x400"); |
| 602 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 604 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 603 const int64_t display_id = display_manager->first_display_id(); | 605 const int64_t display_id = display_manager->first_display_id(); |
| 604 gfx::Display::SetInternalDisplayId(display_id); | 606 display::Display::SetInternalDisplayId(display_id); |
| 605 | 607 |
| 606 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); | 608 GetTray()->ShowDefaultView(BUBBLE_USE_EXISTING); |
| 607 EXPECT_FALSE(IsDisplayVisibleInTray()); | 609 EXPECT_FALSE(IsDisplayVisibleInTray()); |
| 608 | 610 |
| 609 // Accelerometer change does not display. | 611 // Accelerometer change does not display. |
| 610 display_manager->SetDisplayRotation( | 612 display_manager->SetDisplayRotation( |
| 611 display_id, gfx::Display::ROTATE_90, | 613 display_id, display::Display::ROTATE_90, |
| 612 gfx::Display::ROTATION_SOURCE_ACCELEROMETER); | 614 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
| 613 EXPECT_FALSE(IsDisplayVisibleInTray()); | 615 EXPECT_FALSE(IsDisplayVisibleInTray()); |
| 614 | 616 |
| 615 // User change does. | 617 // User change does. |
| 616 display_manager->SetDisplayRotation(display_id, gfx::Display::ROTATE_180, | 618 display_manager->SetDisplayRotation(display_id, display::Display::ROTATE_180, |
| 617 gfx::Display::ROTATION_SOURCE_USER); | 619 display::Display::ROTATION_SOURCE_USER); |
| 618 EXPECT_TRUE(IsDisplayVisibleInTray()); | 620 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 619 | 621 |
| 620 // If a user setting matches the accelerometer, do not display if caused by | 622 // If a user setting matches the accelerometer, do not display if caused by |
| 621 // the accelerometer. | 623 // the accelerometer. |
| 622 display_manager->SetDisplayRotation( | 624 display_manager->SetDisplayRotation( |
| 623 display_id, gfx::Display::ROTATE_180, | 625 display_id, display::Display::ROTATE_180, |
| 624 gfx::Display::ROTATION_SOURCE_ACCELEROMETER); | 626 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
| 625 EXPECT_FALSE(IsDisplayVisibleInTray()); | 627 EXPECT_FALSE(IsDisplayVisibleInTray()); |
| 626 | 628 |
| 627 // If a non-rotation setting is changed, display regardless of the source of | 629 // If a non-rotation setting is changed, display regardless of the source of |
| 628 // rotation so that the full message is shown. | 630 // rotation so that the full message is shown. |
| 629 UpdateDisplay("400x400@1.5"); | 631 UpdateDisplay("400x400@1.5"); |
| 630 EXPECT_TRUE(IsDisplayVisibleInTray()); | 632 EXPECT_TRUE(IsDisplayVisibleInTray()); |
| 631 } | 633 } |
| 632 | 634 |
| 633 } // namespace ash | 635 } // namespace ash |
| OLD | NEW |