| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |