| OLD | NEW |
| 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 "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/system/date/date_default_view.h" | 10 #include "ash/common/system/date/date_default_view.h" |
| 11 #include "ash/common/system/date/date_view.h" | 11 #include "ash/common/system/date/date_view.h" |
| 12 #include "ash/common/system/date/system_info_default_view.h" | 12 #include "ash/common/system/date/system_info_default_view.h" |
| 13 #include "ash/common/system/date/tray_date.h" | 13 #include "ash/common/system/date/tray_date.h" |
| 14 #include "ash/common/system/date/tray_system_info.h" | 14 #include "ash/common/system/date/tray_system_info.h" |
| 15 #include "ash/common/system/tray/system_tray.h" | 15 #include "ash/common/system/tray/system_tray.h" |
| 16 #include "ash/common/system/update/tray_update.h" | |
| 17 #include "ash/common/wm_shell.h" | |
| 18 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 19 #include "base/macros.h" | 17 #include "base/macros.h" |
| 20 #include "chrome/browser/chromeos/login/login_manager_test.h" | 18 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 21 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 19 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 22 #include "chrome/browser/chromeos/login/startup_utils.h" | 20 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 23 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 21 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 24 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 22 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 25 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 27 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 CreateDefaultView(); | 122 CreateDefaultView(); |
| 125 EXPECT_EQ(base::k12HourClock, GetHourType()); | 123 EXPECT_EQ(base::k12HourClock, GetHourType()); |
| 126 | 124 |
| 127 user_manager::UserManager::Get()->SwitchActiveUser(account_id1_); | 125 user_manager::UserManager::Get()->SwitchActiveUser(account_id1_); |
| 128 // Allow clock setting to be sent to ash over mojo. | 126 // Allow clock setting to be sent to ash over mojo. |
| 129 content::RunAllPendingInMessageLoop(); | 127 content::RunAllPendingInMessageLoop(); |
| 130 CreateDefaultView(); | 128 CreateDefaultView(); |
| 131 EXPECT_EQ(base::k24HourClock, GetHourType()); | 129 EXPECT_EQ(base::k24HourClock, GetHourType()); |
| 132 } | 130 } |
| 133 | 131 |
| 134 // Test that a flash update causes the update UI to show in the system menu. | |
| 135 IN_PROC_BROWSER_TEST_F(SystemTrayDelegateChromeOSTest, | |
| 136 TestFlashUpdateTrayIcon) { | |
| 137 ash::TrayUpdate* tray_update = ash::Shell::GetInstance() | |
| 138 ->GetPrimarySystemTray() | |
| 139 ->GetTrayUpdateForTesting(); | |
| 140 | |
| 141 ash::UpdateInfo initial_info; | |
| 142 ash::WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo( | |
| 143 &initial_info); | |
| 144 EXPECT_FALSE(initial_info.update_required); | |
| 145 | |
| 146 // When no update is pending, the item isn't visible. | |
| 147 EXPECT_FALSE(tray_update->tray_view()->visible()); | |
| 148 | |
| 149 chromeos::SystemTrayDelegateChromeOS::instance()->SetFlashUpdateAvailable(); | |
| 150 | |
| 151 ash::UpdateInfo post_info; | |
| 152 ash::WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&post_info); | |
| 153 EXPECT_TRUE(post_info.update_required); | |
| 154 | |
| 155 // Tray item is now visible. | |
| 156 EXPECT_TRUE(tray_update->tray_view()->visible()); | |
| 157 } | |
| 158 | |
| 159 } // namespace chromeos | 132 } // namespace chromeos |
| OLD | NEW |