| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/web_contents/aura/overscroll_window_delegate.h" | 5 #include "content/browser/web_contents/aura/overscroll_window_delegate.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 7 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
| 8 #include "content/public/browser/overscroll_configuration.h" | 8 #include "content/public/browser/overscroll_configuration.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Accessors. | 48 // Accessors. |
| 49 aura::Window* window() { return window_.get(); } | 49 aura::Window* window() { return window_.get(); } |
| 50 | 50 |
| 51 bool overscroll_complete() { return overscroll_complete_; } | 51 bool overscroll_complete() { return overscroll_complete_; } |
| 52 bool overscroll_started() { return overscroll_started_; } | 52 bool overscroll_started() { return overscroll_started_; } |
| 53 bool mode_changed() { return mode_changed_; } | 53 bool mode_changed() { return mode_changed_; } |
| 54 | 54 |
| 55 OverscrollMode current_mode() { return current_mode_; } | 55 OverscrollMode current_mode() { return current_mode_; } |
| 56 | 56 |
| 57 const float touch_start_threshold() { | 57 float touch_start_threshold() { return touch_start_threshold_; } |
| 58 return touch_start_threshold_; | |
| 59 } | |
| 60 | 58 |
| 61 const float touch_complete_threshold() { | 59 float touch_complete_threshold() { |
| 62 return kTestWindowWidth * touch_complete_threshold_; | 60 return kTestWindowWidth * touch_complete_threshold_; |
| 63 } | 61 } |
| 64 | 62 |
| 65 protected: | 63 protected: |
| 66 // aura::test::AuraTestBase: | 64 // aura::test::AuraTestBase: |
| 67 void SetUp() override { | 65 void SetUp() override { |
| 68 aura::test::AuraTestBase::SetUp(); | 66 aura::test::AuraTestBase::SetUp(); |
| 69 Reset(); | 67 Reset(); |
| 70 ui::GestureConfiguration::GetInstance() | 68 ui::GestureConfiguration::GetInstance() |
| 71 ->set_max_touch_move_in_pixels_for_click(0); | 69 ->set_max_touch_move_in_pixels_for_click(0); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 EXPECT_EQ(current_mode(), OVERSCROLL_NONE); | 242 EXPECT_EQ(current_mode(), OVERSCROLL_NONE); |
| 245 EXPECT_FALSE(overscroll_complete()); | 243 EXPECT_FALSE(overscroll_complete()); |
| 246 | 244 |
| 247 // We should be able to restart the overscroll without lifting the finger. | 245 // We should be able to restart the overscroll without lifting the finger. |
| 248 generator.MoveTouch(gfx::Point(touch_x + touch_start_threshold() + 1, 0)); | 246 generator.MoveTouch(gfx::Point(touch_x + touch_start_threshold() + 1, 0)); |
| 249 EXPECT_EQ(current_mode(), OVERSCROLL_EAST); | 247 EXPECT_EQ(current_mode(), OVERSCROLL_EAST); |
| 250 EXPECT_FALSE(overscroll_complete()); | 248 EXPECT_FALSE(overscroll_complete()); |
| 251 } | 249 } |
| 252 | 250 |
| 253 } // namespace content | 251 } // namespace content |
| OLD | NEW |