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/common/wm_shell.h" | |
8 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
9 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/update/tray_update.h" | 9 #include "ash/system/update/tray_update.h" |
| 10 #include "ash/wm_shell.h" |
11 #include "chrome/browser/upgrade_detector.h" | 11 #include "chrome/browser/upgrade_detector.h" |
12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
13 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
14 | 14 |
15 ash::TrayUpdate* GetTrayUpdate() { | 15 ash::TrayUpdate* GetTrayUpdate() { |
16 return ash::WmShell::Get() | 16 return ash::WmShell::Get() |
17 ->GetPrimaryRootWindowController() | 17 ->GetPrimaryRootWindowController() |
18 ->GetSystemTray() | 18 ->GetSystemTray() |
19 ->tray_update(); | 19 ->tray_update(); |
20 } | 20 } |
(...skipping 22 matching lines...) Expand all Loading... |
43 // When no update is pending, the icon isn't visible. | 43 // When no update is pending, the icon isn't visible. |
44 EXPECT_FALSE(tray_update->tray_view()->visible()); | 44 EXPECT_FALSE(tray_update->tray_view()->visible()); |
45 | 45 |
46 // Simulate a Flash update. This sends a mojo message to ash. | 46 // Simulate a Flash update. This sends a mojo message to ash. |
47 SystemTrayClient::Get()->SetFlashUpdateAvailable(); | 47 SystemTrayClient::Get()->SetFlashUpdateAvailable(); |
48 content::RunAllPendingInMessageLoop(); | 48 content::RunAllPendingInMessageLoop(); |
49 | 49 |
50 // Tray icon is now visible. | 50 // Tray icon is now visible. |
51 EXPECT_TRUE(tray_update->tray_view()->visible()); | 51 EXPECT_TRUE(tray_update->tray_view()->visible()); |
52 } | 52 } |
OLD | NEW |