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/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | |
11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
12 #include "ash/shelf/app_list_button.h" | 11 #include "ash/shelf/app_list_button.h" |
13 #include "ash/shelf/overflow_bubble.h" | 12 #include "ash/shelf/overflow_bubble.h" |
14 #include "ash/shelf/overflow_bubble_view.h" | 13 #include "ash/shelf/overflow_bubble_view.h" |
15 #include "ash/shelf/shelf.h" | 14 #include "ash/shelf/shelf.h" |
16 #include "ash/shelf/shelf_button.h" | 15 #include "ash/shelf/shelf_button.h" |
17 #include "ash/shelf/shelf_constants.h" | 16 #include "ash/shelf/shelf_constants.h" |
18 #include "ash/shelf/shelf_icon_observer.h" | 17 #include "ash/shelf/shelf_icon_observer.h" |
19 #include "ash/shelf/shelf_item_delegate_manager.h" | 18 #include "ash/shelf/shelf_item_delegate_manager.h" |
20 #include "ash/shelf/shelf_layout_manager.h" | 19 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 11 matching lines...) Expand all Loading... |
32 #include "ash/test/test_shelf_item_delegate.h" | 31 #include "ash/test/test_shelf_item_delegate.h" |
33 #include "base/basictypes.h" | 32 #include "base/basictypes.h" |
34 #include "base/command_line.h" | 33 #include "base/command_line.h" |
35 #include "base/compiler_specific.h" | 34 #include "base/compiler_specific.h" |
36 #include "base/memory/scoped_ptr.h" | 35 #include "base/memory/scoped_ptr.h" |
37 #include "base/strings/string_number_conversions.h" | 36 #include "base/strings/string_number_conversions.h" |
38 #include "ui/aura/test/aura_test_base.h" | 37 #include "ui/aura/test/aura_test_base.h" |
39 #include "ui/aura/window.h" | 38 #include "ui/aura/window.h" |
40 #include "ui/aura/window_event_dispatcher.h" | 39 #include "ui/aura/window_event_dispatcher.h" |
41 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/ui_base_switches.h" |
42 #include "ui/compositor/layer.h" | 42 #include "ui/compositor/layer.h" |
43 #include "ui/events/event.h" | 43 #include "ui/events/event.h" |
44 #include "ui/events/event_constants.h" | 44 #include "ui/events/event_constants.h" |
45 #include "ui/events/test/event_generator.h" | 45 #include "ui/events/test/event_generator.h" |
46 #include "ui/views/view_model.h" | 46 #include "ui/views/view_model.h" |
47 #include "ui/views/widget/widget.h" | 47 #include "ui/views/widget/widget.h" |
48 #include "ui/views/widget/widget_delegate.h" | 48 #include "ui/views/widget/widget_delegate.h" |
49 #include "ui/wm/core/coordinate_conversion.h" | 49 #include "ui/wm/core/coordinate_conversion.h" |
50 | 50 |
51 namespace ash { | 51 namespace ash { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 public: | 290 public: |
291 ShelfViewTest() | 291 ShelfViewTest() |
292 : model_(NULL), | 292 : model_(NULL), |
293 shelf_view_(NULL), | 293 shelf_view_(NULL), |
294 browser_index_(1), | 294 browser_index_(1), |
295 item_manager_(NULL) {} | 295 item_manager_(NULL) {} |
296 virtual ~ShelfViewTest() {} | 296 virtual ~ShelfViewTest() {} |
297 | 297 |
298 virtual void SetUp() OVERRIDE { | 298 virtual void SetUp() OVERRIDE { |
299 CommandLine::ForCurrentProcess()->AppendSwitch( | 299 CommandLine::ForCurrentProcess()->AppendSwitch( |
300 switches::kAshEnableTouchViewTouchFeedback); | 300 switches::kEnableTouchFeedback); |
301 AshTestBase::SetUp(); | 301 AshTestBase::SetUp(); |
302 test::ShellTestApi test_api(Shell::GetInstance()); | 302 test::ShellTestApi test_api(Shell::GetInstance()); |
303 model_ = test_api.shelf_model(); | 303 model_ = test_api.shelf_model(); |
304 Shelf* shelf = Shelf::ForPrimaryDisplay(); | 304 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
305 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); | 305 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); |
306 | 306 |
307 // The bounds should be big enough for 4 buttons + overflow chevron. | 307 // The bounds should be big enough for 4 buttons + overflow chevron. |
308 shelf_view_->SetBounds(0, 0, 500, kShelfSize); | 308 shelf_view_->SetBounds(0, 0, 500, kShelfSize); |
309 | 309 |
310 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); | 310 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 test_api_->RunMessageLoopUntilAnimationsDone(); | 1763 test_api_->RunMessageLoopUntilAnimationsDone(); |
1764 CheckAllItemsAreInBounds(); | 1764 CheckAllItemsAreInBounds(); |
1765 } | 1765 } |
1766 | 1766 |
1767 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); | 1767 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); |
1768 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, | 1768 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, |
1769 testing::Bool()); | 1769 testing::Bool()); |
1770 | 1770 |
1771 } // namespace test | 1771 } // namespace test |
1772 } // namespace ash | 1772 } // namespace ash |
OLD | NEW |