| 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" |
| 11 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
| 12 #include "ash/system/tray/system_tray_test_api.h" |
| 12 #include "ash/system/update/tray_update.h" | 13 #include "ash/system/update/tray_update.h" |
| 13 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 14 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| 14 #include "chrome/browser/upgrade_detector.h" | 15 #include "chrome/browser/upgrade_detector.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 // TODO(jamescook): Add a test-only mojo API to get system tray details. | 21 // TODO(jamescook): Add a test-only mojo API to get system tray details. |
| 21 ash::SystemTray* GetSystemTray() { | 22 ash::SystemTray* GetSystemTray() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Mark the device as enterprise managed. | 63 // Mark the device as enterprise managed. |
| 63 policy::DevicePolicyCrosTestHelper::MarkAsEnterpriseOwnedBy("example.com"); | 64 policy::DevicePolicyCrosTestHelper::MarkAsEnterpriseOwnedBy("example.com"); |
| 64 content::RunAllPendingInMessageLoop(); | 65 content::RunAllPendingInMessageLoop(); |
| 65 | 66 |
| 66 // Open the system tray menu. | 67 // Open the system tray menu. |
| 67 ash::SystemTray* system_tray = GetSystemTray(); | 68 ash::SystemTray* system_tray = GetSystemTray(); |
| 68 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); | 69 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); |
| 69 | 70 |
| 70 // Managed devices show an item in the menu. | 71 // Managed devices show an item in the menu. |
| 71 ash::TrayEnterprise* tray_enterprise = | 72 ash::TrayEnterprise* tray_enterprise = |
| 72 system_tray->GetTrayEnterpriseForTesting(); | 73 ash::SystemTrayTestApi(system_tray).tray_enterprise(); |
| 73 ASSERT_TRUE(tray_enterprise->tray_view()); | 74 ASSERT_TRUE(tray_enterprise->tray_view()); |
| 74 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); | 75 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); |
| 75 | 76 |
| 76 system_tray->CloseSystemBubble(); | 77 system_tray->CloseSystemBubble(); |
| 77 } | 78 } |
| OLD | NEW |