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

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: 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"
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 =
msw 2016/06/10 18:48:20 nit: use AshTestBase::GetSystemTrayDelegate
James Cook 2016/06/10 20:20:28 Done.
420 static_cast<test::TestSystemTrayDelegate*>( 421 static_cast<test::TestSystemTrayDelegate*>(
421 Shell::GetInstance()->system_tray_delegate()); 422 WmShell::Get()->system_tray_delegate());
422 tray_delegate->set_should_show_display_notification(true); 423 tray_delegate->set_should_show_display_notification(true);
423 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); 424 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
424 425
425 message_center::MessageCenter* message_center = 426 message_center::MessageCenter* message_center =
426 message_center::MessageCenter::Get(); 427 message_center::MessageCenter::Get();
427 428
428 EXPECT_EQ(0u, message_center->NotificationCount()); 429 EXPECT_EQ(0u, message_center->NotificationCount());
429 EXPECT_FALSE(message_center->HasPopupNotifications()); 430 EXPECT_FALSE(message_center->HasPopupNotifications());
430 431
431 // Make sure notifications are still displayed when 432 // Make sure notifications are still displayed when
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 .GetActiveRotation()); 652 .GetActiveRotation());
652 653
653 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( 654 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation(
654 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); 655 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE);
655 656
656 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) 657 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId)
657 .GetActiveRotation()); 658 .GetActiveRotation());
658 } 659 }
659 660
660 } // namespace ash 661 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.cc ('k') | ash/metrics/user_metrics_recorder.cc » ('j') | ash/shell.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698