Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/ui/ash/system_tray_client_browsertest.cc

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Clean up code Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 using SystemTrayClientTest = InProcessBrowserTest; 27 using SystemTrayClientTest = InProcessBrowserTest;
28 28
29 // Test that a chrome update shows the update icon in the system menu. 29 // Test that a chrome update shows the update icon in the system menu.
30 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) { 30 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) {
31 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); 31 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update();
32 32
33 // When no update is pending, the icon isn't visible. 33 // When no update is pending, the icon isn't visible.
34 EXPECT_FALSE(tray_update->tray_view()->visible()); 34 EXPECT_FALSE(tray_update->tray_view()->visible());
35 35
36 // Simulate an upgrade. This sends a mojo message to ash. 36 // Simulate an upgrade. This sends a mojo message to ash.
37 UpgradeDetector::GetInstance()->NotifyUpgradeRecommended(); 37 UpgradeDetector::GetInstance()->NotifyUpgrade();
38 content::RunAllPendingInMessageLoop(); 38 content::RunAllPendingInMessageLoop();
39 39
40 // Tray icon is now visible. 40 // Tray icon is now visible.
41 EXPECT_TRUE(tray_update->tray_view()->visible()); 41 EXPECT_TRUE(tray_update->tray_view()->visible());
42 } 42 }
43 43
44 // Test that a flash update causes the update UI to show in the system menu. 44 // Test that a flash update causes the update UI to show in the system menu.
45 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, FlashUpdateTrayIcon) { 45 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, FlashUpdateTrayIcon) {
46 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); 46 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update();
47 47
(...skipping 20 matching lines...) Expand all
68 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); 68 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW);
69 69
70 // Managed devices show an item in the menu. 70 // Managed devices show an item in the menu.
71 ash::TrayEnterprise* tray_enterprise = 71 ash::TrayEnterprise* tray_enterprise =
72 system_tray->GetTrayEnterpriseForTesting(); 72 system_tray->GetTrayEnterpriseForTesting();
73 ASSERT_TRUE(tray_enterprise->tray_view()); 73 ASSERT_TRUE(tray_enterprise->tray_view());
74 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); 74 EXPECT_TRUE(tray_enterprise->tray_view()->visible());
75 75
76 system_tray->CloseSystemBubble(); 76 system_tray->CloseSystemBubble();
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698