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

Side by Side Diff: ash/launcher/launcher_unittest.cc

Issue 11594004: Revert 173417 - Broke on win_aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 | « ash/launcher/launcher.cc ('k') | ash/wm/ash_activation_controller.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/launcher/launcher.h" 5 #include "ash/launcher/launcher.h"
6 #include "ash/launcher/launcher_button.h" 6 #include "ash/launcher/launcher_button.h"
7 #include "ash/launcher/launcher_model.h" 7 #include "ash/launcher/launcher_model.h"
8 #include "ash/launcher/launcher_view.h" 8 #include "ash/launcher/launcher_view.h"
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/test/launcher_view_test_api.h" 12 #include "ash/test/launcher_view_test_api.h"
13 #include "ash/wm/window_util.h"
14 #include "ui/views/view.h" 13 #include "ui/views/view.h"
15 #include "ui/views/widget/widget.h" 14 #include "ui/views/widget/widget.h"
16 15
17 typedef ash::test::AshTestBase LauncherTest; 16 typedef ash::test::AshTestBase LauncherTest;
18 using ash::internal::LauncherView; 17 using ash::internal::LauncherView;
19 using ash::internal::LauncherButton; 18 using ash::internal::LauncherButton;
20 19
21 namespace ash { 20 namespace ash {
22 21
23 // Makes sure invoking SetStatusSize on the launcher changes the size of the 22 // Makes sure invoking SetStatusSize on the launcher changes the size of the
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 int index = model->Add(item); 70 int index = model->Add(item);
72 ASSERT_EQ(++button_count, test.GetButtonCount()); 71 ASSERT_EQ(++button_count, test.GetButtonCount());
73 LauncherButton* button = test.GetButton(index); 72 LauncherButton* button = test.GetButton(index);
74 EXPECT_EQ(LauncherButton::STATE_RUNNING, button->state()); 73 EXPECT_EQ(LauncherButton::STATE_RUNNING, button->state());
75 74
76 // Remove it. 75 // Remove it.
77 model->RemoveItemAt(index); 76 model->RemoveItemAt(index);
78 ASSERT_EQ(--button_count, test.GetButtonCount()); 77 ASSERT_EQ(--button_count, test.GetButtonCount());
79 } 78 }
80 79
81 // Launcher can't be activated on mouse click, but it is activable from
82 // the focus cycler or as fallback.
83 TEST_F(LauncherTest, ActivateAsFallback) {
84 Launcher* launcher = Launcher::ForPrimaryDisplay();
85 views::Widget* launcher_widget = launcher->widget();
86 EXPECT_FALSE(launcher_widget->CanActivate());
87
88 launcher->WillActivateAsFallback();
89 EXPECT_TRUE(launcher_widget->CanActivate());
90
91 wm::ActivateWindow(launcher_widget->GetNativeWindow());
92 EXPECT_FALSE(launcher_widget->CanActivate());
93 }
94
95 } // namespace ash 80 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher.cc ('k') | ash/wm/ash_activation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698