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

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

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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_port.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/update/tray_update.h" 12 #include "ash/system/update/tray_update.h"
13 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 13 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
14 #include "chrome/browser/upgrade_detector.h" 14 #include "chrome/browser/upgrade_detector.h"
15 #include "chrome/test/base/in_process_browser_test.h" 15 #include "chrome/test/base/in_process_browser_test.h"
16 #include "content/public/test/test_utils.h" 16 #include "content/public/test/test_utils.h"
17 17
18 namespace { 18 namespace {
19 19
20 // TODO(jamescook): Add a test-only mojo API to get system tray details. 20 // TODO(jamescook): Add a test-only mojo API to get system tray details.
21 ash::SystemTray* GetSystemTray() { 21 ash::SystemTray* GetSystemTray() {
22 return ash::ShellPort::Get() 22 return ash::Shell::GetPrimaryRootWindowController()->GetSystemTray();
23 ->GetPrimaryRootWindowController()
24 ->GetSystemTray();
25 } 23 }
26 24
27 } // namespace 25 } // namespace
28 26
29 using SystemTrayClientTest = InProcessBrowserTest; 27 using SystemTrayClientTest = InProcessBrowserTest;
30 28
31 // 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.
32 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) { 30 IN_PROC_BROWSER_TEST_F(SystemTrayClientTest, UpdateTrayIcon) {
33 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update(); 31 ash::TrayUpdate* tray_update = GetSystemTray()->tray_update();
34 32
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW); 68 system_tray->ShowDefaultView(ash::BUBBLE_CREATE_NEW);
71 69
72 // Managed devices show an item in the menu. 70 // Managed devices show an item in the menu.
73 ash::TrayEnterprise* tray_enterprise = 71 ash::TrayEnterprise* tray_enterprise =
74 system_tray->GetTrayEnterpriseForTesting(); 72 system_tray->GetTrayEnterpriseForTesting();
75 ASSERT_TRUE(tray_enterprise->tray_view()); 73 ASSERT_TRUE(tray_enterprise->tray_view());
76 EXPECT_TRUE(tray_enterprise->tray_view()->visible()); 74 EXPECT_TRUE(tray_enterprise->tray_view()->visible());
77 75
78 system_tray->CloseSystemBubble(); 76 system_tray->CloseSystemBubble();
79 } 77 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/shelf_browsertest.cc ('k') | chrome/browser/ui/webui/chromeos/first_run/first_run_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698