diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 16:11:39 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 16:11:39 +0000 |
commit | 860f594adad88104987735b515344f7491b1e8ff (patch) | |
tree | 70581b5c8b447c706cf005eb8550da7e612ac448 /ash/focus_cycler_unittest.cc | |
parent | 69d5be3f63008c46a937ffb9e62d230ec50ac981 (diff) | |
download | chromium_src-860f594adad88104987735b515344f7491b1e8ff.zip chromium_src-860f594adad88104987735b515344f7491b1e8ff.tar.gz chromium_src-860f594adad88104987735b515344f7491b1e8ff.tar.bz2 |
Revert 133691 because it accidentally reverted revs 133686 and 133684.
TBR=sadrul@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10202012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/focus_cycler_unittest.cc')
-rw-r--r-- | ash/focus_cycler_unittest.cc | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc index 23468f3..9f3e429 100644 --- a/ash/focus_cycler_unittest.cc +++ b/ash/focus_cycler_unittest.cc @@ -7,7 +7,8 @@ #include "ash/launcher/launcher.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" -#include "ash/status_area/status_area_view.h" +#include "ash/system/tray/system_tray.h" +#include "ash/system/tray/system_tray_widget_delegate.h" #include "ash/wm/window_util.h" #include "ash/test/ash_test_base.h" #include "ash/shell_factory.h" @@ -30,6 +31,12 @@ internal::StatusAreaView* GetStatusAreaView(views::Widget* widget) { widget->GetContentsView()); } +SystemTray* CreateSystemTray() { + SystemTray* tray = new SystemTray; + tray->CreateWidget(); + return tray; +} + } // namespace typedef AshTestBase FocusCyclerTest; @@ -54,10 +61,10 @@ TEST_F(FocusCyclerTest, CycleFocusForward) { scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); // Add the Status area - views::Widget* status_widget = internal::CreateStatusArea(NULL); - ASSERT_TRUE(status_widget); - focus_cycler->AddWidget(status_widget); - GetStatusAreaView(status_widget)->SetFocusCyclerForTesting( + scoped_ptr<SystemTray> tray(CreateSystemTray()); + ASSERT_TRUE(tray->widget()); + focus_cycler->AddWidget(tray->widget()); + GetStatusAreaView(tray->widget())->SetFocusCyclerForTesting( focus_cycler.get()); // Add the launcher @@ -77,7 +84,7 @@ TEST_F(FocusCyclerTest, CycleFocusForward) { // Cycle focus to the status area focus_cycler->RotateFocus(FocusCycler::FORWARD); - EXPECT_TRUE(status_widget->IsActive()); + EXPECT_TRUE(tray->widget()->IsActive()); // Cycle focus to the launcher focus_cycler->RotateFocus(FocusCycler::FORWARD); @@ -92,10 +99,10 @@ TEST_F(FocusCyclerTest, CycleFocusBackward) { scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); // Add the Status area - views::Widget* status_widget = internal::CreateStatusArea(NULL); - ASSERT_TRUE(status_widget); - focus_cycler->AddWidget(status_widget); - GetStatusAreaView(status_widget)->SetFocusCyclerForTesting( + scoped_ptr<SystemTray> tray(CreateSystemTray()); + ASSERT_TRUE(tray->widget()); + focus_cycler->AddWidget(tray->widget()); + GetStatusAreaView(tray->widget())->SetFocusCyclerForTesting( focus_cycler.get()); // Add the launcher @@ -119,7 +126,7 @@ TEST_F(FocusCyclerTest, CycleFocusBackward) { // Cycle focus to the status area focus_cycler->RotateFocus(FocusCycler::BACKWARD); - EXPECT_TRUE(status_widget->IsActive()); + EXPECT_TRUE(tray->widget()->IsActive()); // Cycle focus to the browser focus_cycler->RotateFocus(FocusCycler::BACKWARD); @@ -161,10 +168,10 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusForwardInvisible) { scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); // Add the Status area - views::Widget* status_widget = internal::CreateStatusArea(NULL); - ASSERT_TRUE(status_widget); - focus_cycler->AddWidget(status_widget); - GetStatusAreaView(status_widget)->SetFocusCyclerForTesting( + scoped_ptr<SystemTray> tray(CreateSystemTray()); + ASSERT_TRUE(tray->widget()); + focus_cycler->AddWidget(tray->widget()); + GetStatusAreaView(tray->widget())->SetFocusCyclerForTesting( focus_cycler.get()); // Add the launcher @@ -184,7 +191,7 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusForwardInvisible) { // Cycle focus to the status area focus_cycler->RotateFocus(FocusCycler::FORWARD); - EXPECT_TRUE(status_widget->IsActive()); + EXPECT_TRUE(tray->widget()->IsActive()); // Cycle focus to the browser focus_cycler->RotateFocus(FocusCycler::FORWARD); @@ -195,10 +202,10 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusBackwardInvisible) { scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); // Add the Status area - views::Widget* status_widget = internal::CreateStatusArea(NULL); - ASSERT_TRUE(status_widget); - focus_cycler->AddWidget(status_widget); - GetStatusAreaView(status_widget)->SetFocusCyclerForTesting( + scoped_ptr<SystemTray> tray(CreateSystemTray()); + ASSERT_TRUE(tray->widget()); + focus_cycler->AddWidget(tray->widget()); + GetStatusAreaView(tray->widget())->SetFocusCyclerForTesting( focus_cycler.get()); // Add the launcher @@ -218,7 +225,7 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusBackwardInvisible) { // Cycle focus to the status area focus_cycler->RotateFocus(FocusCycler::BACKWARD); - EXPECT_TRUE(status_widget->IsActive()); + EXPECT_TRUE(tray->widget()->IsActive()); // Cycle focus to the browser focus_cycler->RotateFocus(FocusCycler::BACKWARD); |