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

Side by Side Diff: ash/content/display/screen_orientation_controller_chromeos_unittest.cc

Issue 2400553002: ash: Remove broken display notification suppression when settings is open (Closed)
Patch Set: fix tests Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/display/screen_orientation_controller_chromeos.h" 5 #include "ash/display/screen_orientation_controller_chromeos.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
12 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
13 #include "ash/content/shell_content_state.h" 13 #include "ash/content/shell_content_state.h"
14 #include "ash/display/display_manager.h" 14 #include "ash/display/display_manager.h"
15 #include "ash/shell.h" 15 #include "ash/shell.h"
16 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
17 #include "ash/test/ash_test_environment_content.h" 17 #include "ash/test/ash_test_environment_content.h"
18 #include "ash/test/ash_test_helper.h" 18 #include "ash/test/ash_test_helper.h"
19 #include "ash/test/content/test_shell_content_state.h" 19 #include "ash/test/content/test_shell_content_state.h"
20 #include "ash/test/display_manager_test_api.h" 20 #include "ash/test/display_manager_test_api.h"
21 #include "ash/test/test_shell_delegate.h" 21 #include "ash/test/test_shell_delegate.h"
22 #include "ash/test/test_system_tray_delegate.h"
23 #include "base/command_line.h" 22 #include "base/command_line.h"
24 #include "chromeos/accelerometer/accelerometer_reader.h" 23 #include "chromeos/accelerometer/accelerometer_reader.h"
25 #include "chromeos/accelerometer/accelerometer_types.h" 24 #include "chromeos/accelerometer/accelerometer_types.h"
26 #include "content/public/browser/browser_context.h" 25 #include "content/public/browser/browser_context.h"
27 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
28 #include "content/public/test/test_browser_context.h" 27 #include "content/public/test/test_browser_context.h"
29 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h" 28 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h"
30 #include "ui/aura/window.h" 29 #include "ui/aura/window.h"
31 #include "ui/display/display.h" 30 #include "ui/display/display.h"
32 #include "ui/display/display_switches.h" 31 #include "ui/display/display_switches.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 TriggerLidUpdate(gravity); 412 TriggerLidUpdate(gravity);
414 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); 413 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
415 } 414 }
416 415
417 // The ScreenLayoutObserver class that is responsible for adding/updating 416 // The ScreenLayoutObserver class that is responsible for adding/updating
418 // MessageCenter notifications is only added to the SystemTray on ChromeOS. 417 // MessageCenter notifications is only added to the SystemTray on ChromeOS.
419 // Tests that the screen rotation notifications are suppressed when 418 // Tests that the screen rotation notifications are suppressed when
420 // triggered by the accelerometer. 419 // triggered by the accelerometer.
421 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) { 420 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) {
422 EnableMaximizeMode(true); 421 EnableMaximizeMode(true);
423 test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate();
424 tray_delegate->set_should_show_display_notification(true);
425 test::DisplayManagerTestApi(display_manager()) 422 test::DisplayManagerTestApi(display_manager())
426 .SetFirstDisplayAsInternalDisplay(); 423 .SetFirstDisplayAsInternalDisplay();
427 424
428 message_center::MessageCenter* message_center = 425 message_center::MessageCenter* message_center =
429 message_center::MessageCenter::Get(); 426 message_center::MessageCenter::Get();
430 427
431 EXPECT_EQ(0u, message_center->NotificationCount()); 428 EXPECT_EQ(0u, message_center->NotificationCount());
432 EXPECT_FALSE(message_center->HasPopupNotifications()); 429 EXPECT_FALSE(message_center->HasPopupNotifications());
433 430
434 // Make sure notifications are still displayed when 431 // Make sure notifications are still displayed when
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 655
659 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( 656 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation(
660 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); 657 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE);
661 658
662 EXPECT_EQ(kNewRotation, display_manager() 659 EXPECT_EQ(kNewRotation, display_manager()
663 ->GetDisplayInfo(kInternalDisplayId) 660 ->GetDisplayInfo(kInternalDisplayId)
664 .GetActiveRotation()); 661 .GetActiveRotation());
665 } 662 }
666 663
667 } // namespace ash 664 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698