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

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

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 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/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/common/wm_shell.h"
msw 2016/06/10 20:48:10 nit: remove
11 #include "ash/content/shell_content_state.h" 12 #include "ash/content/shell_content_state.h"
12 #include "ash/display/display_info.h" 13 #include "ash/display/display_info.h"
13 #include "ash/display/display_manager.h" 14 #include "ash/display/display_manager.h"
14 #include "ash/shell.h" 15 #include "ash/shell.h"
15 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
16 #include "ash/test/ash_test_helper.h" 17 #include "ash/test/ash_test_helper.h"
17 #include "ash/test/content/test_shell_content_state.h" 18 #include "ash/test/content/test_shell_content_state.h"
18 #include "ash/test/display_manager_test_api.h" 19 #include "ash/test/display_manager_test_api.h"
19 #include "ash/test/test_shell_delegate.h" 20 #include "ash/test/test_shell_delegate.h"
20 #include "ash/test/test_system_tray_delegate.h" 21 #include "ash/test/test_system_tray_delegate.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 TriggerLidUpdate(gravity); 410 TriggerLidUpdate(gravity);
410 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); 411 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
411 } 412 }
412 413
413 // The TrayDisplay class that is responsible for adding/updating MessageCenter 414 // The TrayDisplay class that is responsible for adding/updating MessageCenter
414 // notifications is only added to the SystemTray on ChromeOS. 415 // notifications is only added to the SystemTray on ChromeOS.
415 // Tests that the screen rotation notifications are suppressed when 416 // Tests that the screen rotation notifications are suppressed when
416 // triggered by the accelerometer. 417 // triggered by the accelerometer.
417 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) { 418 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) {
418 EnableMaximizeMode(true); 419 EnableMaximizeMode(true);
419 test::TestSystemTrayDelegate* tray_delegate = 420 test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate();
420 static_cast<test::TestSystemTrayDelegate*>(
421 Shell::GetInstance()->system_tray_delegate());
422 tray_delegate->set_should_show_display_notification(true); 421 tray_delegate->set_should_show_display_notification(true);
423 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); 422 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
424 423
425 message_center::MessageCenter* message_center = 424 message_center::MessageCenter* message_center =
426 message_center::MessageCenter::Get(); 425 message_center::MessageCenter::Get();
427 426
428 EXPECT_EQ(0u, message_center->NotificationCount()); 427 EXPECT_EQ(0u, message_center->NotificationCount());
429 EXPECT_FALSE(message_center->HasPopupNotifications()); 428 EXPECT_FALSE(message_center->HasPopupNotifications());
430 429
431 // Make sure notifications are still displayed when 430 // Make sure notifications are still displayed when
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 .GetActiveRotation()); 650 .GetActiveRotation());
652 651
653 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( 652 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation(
654 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); 653 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE);
655 654
656 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) 655 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId)
657 .GetActiveRotation()); 656 .GetActiveRotation());
658 } 657 }
659 658
660 } // namespace ash 659 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698