| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/ash/system_tray_client.h" | 5 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/enterprise/tray_enterprise.h" | 9 #include "ash/system/enterprise/tray_enterprise.h" |
| 10 #include "ash/system/tray/label_tray_view.h" | 10 #include "ash/system/tray/label_tray_view.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 using SystemTrayClientTest = InProcessBrowserTest; | 28 using SystemTrayClientTest = InProcessBrowserTest; |
| 29 | 29 |
| 30 // Test that a chrome update shows the update icon in the system menu. | 30 // Test that a chrome update shows the update icon in the system menu. |
| 31 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) { | 31 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) { |
| 32 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); | 32 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); |
| 33 | 33 |
| 34 // When no update is pending, the icon isn't visible. | 34 // When no update is pending, the icon isn't visible. |
| 35 EXPECT_FALSE(tray_update->tray_view()->visible()); | 35 EXPECT_FALSE(tray_update->tray_view()->visible()); |
| 36 | 36 |
| 37 // Simulate an upgrade. This sends a mojo message to ash. | 37 // Simulate an upgrade. This sends a mojo message to ash. |
| 38 UpgradeDetector::GetInstance()->NotifyUpgradeRecommended(); | 38 UpgradeDetector::GetInstance()->NotifyUpgrade(); |
| 39 content::RunAllPendingInMessageLoop(); | 39 content::RunAllPendingInMessageLoop(); |
| 40 | 40 |
| 41 // Tray icon is now visible. | 41 // Tray icon is now visible. |
| 42 EXPECT_TRUE(tray_update->tray_view()->visible()); | 42 EXPECT_TRUE(tray_update->tray_view()->visible()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Test that a flash update causes the update UI to show in the system menu. | 45 // Test that a flash update causes the update UI to show in the system menu. |
| 46 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, FlashUpdateTrayIcon) { | 46 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, FlashUpdateTrayIcon) { |
| 47 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); | 47 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); |
| 48 | 48 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 69 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); | 69 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); |
| 70 | 70 |
| 71 // Managed devices show an item in the menu. | 71 // Managed devices show an item in the menu. |
| 72 ash::TrayEnterprise* tray_enterprise = | 72 ash::TrayEnterprise* tray_enterprise = |
| 73 ash::SystemTrayTestApi(system_tray).tray_enterprise(); | 73 ash::SystemTrayTestApi(system_tray).tray_enterprise(); |
| 74 ASSERT_TRUE(tray_enterprise->tray_view()); | 74 ASSERT_TRUE(tray_enterprise->tray_view()); |
| 75 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); | 75 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); |
| 76 | 76 |
| 77 system_tray->CloseSystemBubble(); | 77 system_tray->CloseSystemBubble(); |
| 78 } | 78 } |
| OLD | NEW |