| 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_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ash/wm/window_state.h" | 25 #include "ash/wm/window_state.h" |
| 26 #include "ash/wm/window_util.h" | 26 #include "ash/wm/window_util.h" |
| 27 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "ui/aura/client/aura_constants.h" | 29 #include "ui/aura/client/aura_constants.h" |
| 30 #include "ui/aura/window.h" | 30 #include "ui/aura/window.h" |
| 31 #include "ui/aura/window_event_dispatcher.h" | 31 #include "ui/aura/window_event_dispatcher.h" |
| 32 #include "ui/compositor/layer.h" | 32 #include "ui/compositor/layer.h" |
| 33 #include "ui/compositor/layer_animator.h" | 33 #include "ui/compositor/layer_animator.h" |
| 34 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 34 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 35 #include "ui/events/gestures/gesture_configuration.h" | 35 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 36 #include "ui/events/test/event_generator.h" | 36 #include "ui/events/test/event_generator.h" |
| 37 #include "ui/gfx/display.h" | 37 #include "ui/gfx/display.h" |
| 38 #include "ui/gfx/screen.h" | 38 #include "ui/gfx/screen.h" |
| 39 #include "ui/views/controls/label.h" | 39 #include "ui/views/controls/label.h" |
| 40 #include "ui/views/layout/fill_layout.h" | 40 #include "ui/views/layout/fill_layout.h" |
| 41 #include "ui/views/view.h" | 41 #include "ui/views/view.h" |
| 42 #include "ui/views/widget/widget.h" | 42 #include "ui/views/widget/widget.h" |
| 43 | 43 |
| 44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 45 #include "base/win/windows_version.h" | 45 #include "base/win/windows_version.h" |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 #if defined(OS_WIN) | 1579 #if defined(OS_WIN) |
| 1580 // RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962 | 1580 // RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962 |
| 1581 #define MAYBE_GestureDrag DISABLED_GestureDrag | 1581 #define MAYBE_GestureDrag DISABLED_GestureDrag |
| 1582 #else | 1582 #else |
| 1583 #define MAYBE_GestureDrag GestureDrag | 1583 #define MAYBE_GestureDrag GestureDrag |
| 1584 #endif | 1584 #endif |
| 1585 | 1585 |
| 1586 TEST_F(ShelfLayoutManagerTest, MAYBE_GestureDrag) { | 1586 TEST_F(ShelfLayoutManagerTest, MAYBE_GestureDrag) { |
| 1587 // Slop is an implementation detail of gesture recognition, and complicates | 1587 // Slop is an implementation detail of gesture recognition, and complicates |
| 1588 // these tests. Ignore it. | 1588 // these tests. Ignore it. |
| 1589 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(0); | 1589 ui::GestureConfiguration::GetInstance() |
| 1590 ->set_max_touch_move_in_pixels_for_click(0); |
| 1590 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | 1591 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
| 1591 { | 1592 { |
| 1592 SCOPED_TRACE("BOTTOM"); | 1593 SCOPED_TRACE("BOTTOM"); |
| 1593 RunGestureDragTests(gfx::Vector2d(0, 120)); | 1594 RunGestureDragTests(gfx::Vector2d(0, 120)); |
| 1594 } | 1595 } |
| 1595 | 1596 |
| 1596 { | 1597 { |
| 1597 SCOPED_TRACE("LEFT"); | 1598 SCOPED_TRACE("LEFT"); |
| 1598 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); | 1599 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); |
| 1599 RunGestureDragTests(gfx::Vector2d(-120, 0)); | 1600 RunGestureDragTests(gfx::Vector2d(-120, 0)); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN); | 2023 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN); |
| 2023 gfx::Rect hide_target_bounds = status_window->GetTargetBounds(); | 2024 gfx::Rect hide_target_bounds = status_window->GetTargetBounds(); |
| 2024 EXPECT_GT(hide_target_bounds.y(), initial_bounds.y()); | 2025 EXPECT_GT(hide_target_bounds.y(), initial_bounds.y()); |
| 2025 | 2026 |
| 2026 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 2027 shelf_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
| 2027 gfx::Rect reshow_target_bounds = status_window->GetTargetBounds(); | 2028 gfx::Rect reshow_target_bounds = status_window->GetTargetBounds(); |
| 2028 EXPECT_EQ(initial_bounds, reshow_target_bounds); | 2029 EXPECT_EQ(initial_bounds, reshow_target_bounds); |
| 2029 } | 2030 } |
| 2030 | 2031 |
| 2031 } // namespace ash | 2032 } // namespace ash |
| OLD | NEW |