| 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/screen_layout_observer.h" | 5 #include "ash/system/chromeos/screen_layout_observer.h" |
| 6 | 6 |
| 7 #include "ash/common/strings/grit/ash_strings.h" | 7 #include "ash/common/strings/grit/ash_strings.h" |
| 8 #include "ash/common/system/chromeos/devicetype_utils.h" | 8 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 9 #include "ash/common/system/tray/system_tray.h" | 9 #include "ash/common/system/tray/system_tray.h" |
| 10 #include "ash/common/test/test_system_tray_delegate.h" | 10 #include "ash/common/test/test_system_tray_delegate.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 base::string16 ScreenLayoutObserverTest::GetMirroringDisplayName() { | 88 base::string16 ScreenLayoutObserverTest::GetMirroringDisplayName() { |
| 89 return base::UTF8ToUTF16(display_manager()->GetDisplayNameForId( | 89 return base::UTF8ToUTF16(display_manager()->GetDisplayNameForId( |
| 90 display_manager()->mirroring_display_id())); | 90 display_manager()->mirroring_display_id())); |
| 91 } | 91 } |
| 92 | 92 |
| 93 const message_center::Notification* | 93 const message_center::Notification* |
| 94 ScreenLayoutObserverTest::GetDisplayNotification() const { | 94 ScreenLayoutObserverTest::GetDisplayNotification() const { |
| 95 const message_center::NotificationList::Notifications notifications = | 95 const message_center::NotificationList::Notifications notifications = |
| 96 message_center::MessageCenter::Get()->GetVisibleNotifications(); | 96 message_center::MessageCenter::Get()->GetVisibleNotifications(); |
| 97 for (const auto& notification : notifications) { | 97 for (auto* notification : notifications) { |
| 98 if (notification->id() == ScreenLayoutObserver::kNotificationId) | 98 if (notification->id() == ScreenLayoutObserver::kNotificationId) |
| 99 return notification; | 99 return notification; |
| 100 } | 100 } |
| 101 | 101 |
| 102 return nullptr; | 102 return nullptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 TEST_F(ScreenLayoutObserverTest, DisplayNotifications) { | 105 TEST_F(ScreenLayoutObserverTest, DisplayNotifications) { |
| 106 Shell::GetInstance() | 106 Shell::GetInstance() |
| 107 ->screen_layout_observer() | 107 ->screen_layout_observer() |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 display_manager()->SetLayoutForCurrentDisplays(builder.Build()); | 434 display_manager()->SetLayoutForCurrentDisplays(builder.Build()); |
| 435 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 435 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 436 | 436 |
| 437 // Close the lid. We go to docked mode, but we show no notifications. | 437 // Close the lid. We go to docked mode, but we show no notifications. |
| 438 UpdateDisplay("400x400"); | 438 UpdateDisplay("400x400"); |
| 439 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 439 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 440 EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); | 440 EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace ash | 443 } // namespace ash |
| OLD | NEW |