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

Side by Side Diff: ash/focus_cycler_unittest.cc

Issue 10535112: Prepare status area to support multiple trays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/focus_cycler.h" 5 #include "ash/focus_cycler.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace { 28 namespace {
29 29
30 internal::StatusAreaWidgetDelegate* GetStatusAreaWidgetDelegate( 30 internal::StatusAreaWidgetDelegate* GetStatusAreaWidgetDelegate(
31 views::Widget* widget) { 31 views::Widget* widget) {
32 return static_cast<internal::StatusAreaWidgetDelegate*>( 32 return static_cast<internal::StatusAreaWidgetDelegate*>(
33 widget->GetContentsView()); 33 widget->GetContentsView());
34 } 34 }
35 35
36 SystemTray* CreateSystemTray() { 36 SystemTray* CreateSystemTray() {
37 SystemTray* tray = new SystemTray;
38 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget; 37 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget;
39 widget->AddTray(tray); 38 widget->CreateTrayViews(NULL);
40 widget->Show(); 39 widget->Show();
41 return tray; 40 return widget->system_tray();
42 } 41 }
43 42
44 } // namespace 43 } // namespace
45 44
46 typedef AshTestBase FocusCyclerTest; 45 typedef AshTestBase FocusCyclerTest;
47 46
48 TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) { 47 TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) {
49 scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); 48 scoped_ptr<FocusCycler> focus_cycler(new FocusCycler());
50 49
51 // Create a single test window. 50 // Create a single test window.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 focus_cycler->RotateFocus(FocusCycler::BACKWARD); 230 focus_cycler->RotateFocus(FocusCycler::BACKWARD);
232 EXPECT_TRUE(tray->GetWidget()->IsActive()); 231 EXPECT_TRUE(tray->GetWidget()->IsActive());
233 232
234 // Cycle focus to the browser 233 // Cycle focus to the browser
235 focus_cycler->RotateFocus(FocusCycler::BACKWARD); 234 focus_cycler->RotateFocus(FocusCycler::BACKWARD);
236 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); 235 EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
237 } 236 }
238 237
239 } // namespace test 238 } // namespace test
240 } // namespace ash 239 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698