// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/web_contents/aura/gesture_nav_simple.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/site_instance.h" #include "content/test/test_render_view_host.h" #include "content/test/test_web_contents.h" #include "ui/aura/window.h" #include <memory> namespace content { namespace { // A subclass of TestWebContents that offers a fake content window. class GestureNavTestWebContents : public TestWebContents { … }; } // namespace class GestureNavSimpleTest : public RenderViewHostImplTestHarness { … }; // Tests that setting 'overscroll-behavior-x' to 'auto' allows gesture-nav. TEST_F(GestureNavSimpleTest, OverscrollBehaviorXAutoAllowsGestureNav) { … } // Tests that setting 'overscroll-behavior-x' to 'contain' prevents gesture-nav. TEST_F(GestureNavSimpleTest, OverscrollBehaviorXContainPreventsGestureNav) { … } // Tests that setting 'overscroll-behavior-x' to 'none' prevents gesture-nav. TEST_F(GestureNavSimpleTest, OverscrollBehaviorXNonePreventsGestureNav) { … } // Tests that setting 'overscroll-behavior-y' to 'auto' allows pull-to-refresh. TEST_F(GestureNavSimpleTest, OverscrollBehaviorYAutoAllowsPullToRefresh) { … } // Tests that setting 'overscroll-behavior-y' to 'contain' prevents // pull-to-refresh. TEST_F(GestureNavSimpleTest, OverscrollBehaviorYContainPreventsPullToRefresh) { … } // Tests that setting 'overscroll-behavior-y' to 'none' prevents // pull-to-refresh. TEST_F(GestureNavSimpleTest, OverscrollBehaviorYNonePreventsPullToRefresh) { … } // Tests that setting 'overscroll-behavior-x' to a value that prevents // gesture-nav after it has started does not affect aborting it. TEST_F(GestureNavSimpleTest, PreventGestureNavBeforeAbort) { … } // Tests that after gesture-nav was prevented due to 'overscroll-behavior-x', // setting it to 'auto' does not affect aborting overscroll. TEST_F(GestureNavSimpleTest, AllowGestureNavBeforeAbort) { … } // Tests that preventing gesture-nav using 'overscroll-behavior-x' does not // affect completing overscroll. TEST_F(GestureNavSimpleTest, CompletePreventedGestureNav) { … } // Tests that setting 'overscroll-behavior-y' to a value that prevents // pull-to-refresh after it has started does not affect aborting it. TEST_F(GestureNavSimpleTest, PreventPullToRefreshBeforeAbort) { … } // Tests that after pull-to-refresh was prevented due to // 'overscroll-behavior-y', setting it to 'auto' does not affect aborting // overscroll. TEST_F(GestureNavSimpleTest, AllowPullToRefreshBeforeAbort) { … } // Tests that preventing pull-to-refresh using 'overscroll-behavior-y' does not // affect completing overscroll. TEST_F(GestureNavSimpleTest, CompletePreventedPullToRefresh) { … } } // namespace content