OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/shelf/shelf_widget.h" | 5 #include "ash/shelf/shelf_widget.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/launcher/launcher_button.h" | 8 #include "ash/launcher/launcher_button.h" |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 ShelfWidget* shelf_widget = launcher->shelf_widget(); | 47 ShelfWidget* shelf_widget = launcher->shelf_widget(); |
48 EXPECT_FALSE(shelf_widget->CanActivate()); | 48 EXPECT_FALSE(shelf_widget->CanActivate()); |
49 | 49 |
50 shelf_widget->WillActivateAsFallback(); | 50 shelf_widget->WillActivateAsFallback(); |
51 EXPECT_TRUE(shelf_widget->CanActivate()); | 51 EXPECT_TRUE(shelf_widget->CanActivate()); |
52 | 52 |
53 wm::ActivateWindow(shelf_widget->GetNativeWindow()); | 53 wm::ActivateWindow(shelf_widget->GetNativeWindow()); |
54 EXPECT_FALSE(shelf_widget->CanActivate()); | 54 EXPECT_FALSE(shelf_widget->CanActivate()); |
55 } | 55 } |
56 | 56 |
57 void TestLauncherAlignment(aura::RootWindow* root, | 57 void TestLauncherAlignment(aura::Window* root, |
58 ShelfAlignment alignment, | 58 ShelfAlignment alignment, |
59 const std::string& expected) { | 59 const std::string& expected) { |
60 Shell::GetInstance()->SetShelfAlignment(alignment, root); | 60 Shell::GetInstance()->SetShelfAlignment(alignment, root); |
61 gfx::Screen* screen = gfx::Screen::GetScreenFor(root); | 61 gfx::Screen* screen = gfx::Screen::GetScreenFor(root); |
62 EXPECT_EQ(expected, | 62 EXPECT_EQ(expected, |
63 screen->GetDisplayNearestWindow(root).work_area().ToString()); | 63 screen->GetDisplayNearestWindow(root).work_area().ToString()); |
64 } | 64 } |
65 | 65 |
66 TEST_F(ShelfWidgetTest, TestAlignment) { | 66 TEST_F(ShelfWidgetTest, TestAlignment) { |
67 Launcher* launcher = Launcher::ForPrimaryDisplay(); | 67 Launcher* launcher = Launcher::ForPrimaryDisplay(); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const int status_width = | 185 const int status_width = |
186 shelf->status_area_widget()->GetWindowBoundsInScreen().width(); | 186 shelf->status_area_widget()->GetWindowBoundsInScreen().width(); |
187 EXPECT_GT(status_width, 0); | 187 EXPECT_GT(status_width, 0); |
188 EXPECT_EQ(status_width, | 188 EXPECT_EQ(status_width, |
189 shelf->GetContentsView()->width() - | 189 shelf->GetContentsView()->width() - |
190 test::LauncherTestAPI(launcher).shelf_view()->width()); | 190 test::LauncherTestAPI(launcher).shelf_view()->width()); |
191 } | 191 } |
192 #endif | 192 #endif |
193 | 193 |
194 } // namespace ash | 194 } // namespace ash |
OLD | NEW |