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/launcher/launcher_view.h" | 5 #include "ash/launcher/launcher_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
11 #include "ash/launcher/launcher_button.h" | 11 #include "ash/launcher/launcher_button.h" |
12 #include "ash/launcher/launcher_icon_observer.h" | 12 #include "ash/launcher/launcher_icon_observer.h" |
13 #include "ash/launcher/launcher_model.h" | 13 #include "ash/launcher/launcher_model.h" |
14 #include "ash/launcher/launcher_tooltip_manager.h" | 14 #include "ash/launcher/launcher_tooltip_manager.h" |
| 15 #include "ash/root_window_controller.h" |
15 #include "ash/shell.h" | 16 #include "ash/shell.h" |
16 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
17 #include "ash/test/launcher_view_test_api.h" | 18 #include "ash/test/launcher_view_test_api.h" |
18 #include "ash/test/test_launcher_delegate.h" | 19 #include "ash/test/test_launcher_delegate.h" |
19 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
20 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
21 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
22 #include "grit/ash_resources.h" | 23 #include "grit/ash_resources.h" |
23 #include "ui/aura/test/aura_test_base.h" | 24 #include "ui/aura/test/aura_test_base.h" |
24 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 public: | 172 public: |
172 LauncherViewTest() {} | 173 LauncherViewTest() {} |
173 virtual ~LauncherViewTest() {} | 174 virtual ~LauncherViewTest() {} |
174 | 175 |
175 virtual void SetUp() OVERRIDE { | 176 virtual void SetUp() OVERRIDE { |
176 AshTestBase::SetUp(); | 177 AshTestBase::SetUp(); |
177 | 178 |
178 model_.reset(new LauncherModel); | 179 model_.reset(new LauncherModel); |
179 | 180 |
180 launcher_view_.reset(new internal::LauncherView( | 181 launcher_view_.reset(new internal::LauncherView( |
181 model_.get(), &delegate_, NULL)); | 182 model_.get(), |
| 183 &delegate_, |
| 184 Shell::GetPrimaryRootWindowController()->shelf())); |
182 launcher_view_->Init(); | 185 launcher_view_->Init(); |
183 // The bounds should be big enough for 4 buttons + overflow chevron. | 186 // The bounds should be big enough for 4 buttons + overflow chevron. |
184 launcher_view_->SetBounds(0, 0, 500, 50); | 187 launcher_view_->SetBounds(0, 0, 500, 50); |
185 | 188 |
186 test_api_.reset(new LauncherViewTestAPI(launcher_view_.get())); | 189 test_api_.reset(new LauncherViewTestAPI(launcher_view_.get())); |
187 test_api_->SetAnimationDuration(1); // Speeds up animation for test. | 190 test_api_->SetAnimationDuration(1); // Speeds up animation for test. |
188 } | 191 } |
189 | 192 |
190 virtual void TearDown() OVERRIDE { | 193 virtual void TearDown() OVERRIDE { |
191 launcher_view_.reset(); | 194 launcher_view_.reset(); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 const int app_list_button_index = test_api_->GetButtonCount() - 1; | 724 const int app_list_button_index = test_api_->GetButtonCount() - 1; |
722 const gfx::Rect& app_list_ideal_bounds = | 725 const gfx::Rect& app_list_ideal_bounds = |
723 test_api_->GetIdealBoundsByIndex(app_list_button_index); | 726 test_api_->GetIdealBoundsByIndex(app_list_button_index); |
724 const gfx::Rect& app_list_bounds = | 727 const gfx::Rect& app_list_bounds = |
725 test_api_->GetBoundsByIndex(app_list_button_index); | 728 test_api_->GetBoundsByIndex(app_list_button_index); |
726 EXPECT_EQ(app_list_bounds, app_list_ideal_bounds); | 729 EXPECT_EQ(app_list_bounds, app_list_ideal_bounds); |
727 } | 730 } |
728 | 731 |
729 } // namespace test | 732 } // namespace test |
730 } // namespace ash | 733 } // namespace ash |
OLD | NEW |