chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc

// Copyright 2015 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/renderer_host/input/touch_selection_controller_client_aura.h"

#include <memory>

#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "content/browser/renderer_host/render_widget_host_view_child_frame.h"
#include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/synchronize_visual_properties_interceptor.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "third_party/blink/public/common/switches.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/pointer/touch_editing_controller.h"
#include "ui/base/ui_base_features.h"
#include "ui/display/display_switches.h"
#include "ui/events/event_sink.h"
#include "ui/events/event_utils.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/test/event_generator.h"
#include "ui/events/test/motion_event_test_utils.h"
#include "ui/touch_selection/touch_selection_controller_test_api.h"
#include "ui/touch_selection/touch_selection_metrics.h"

namespace content {
namespace {

// Character dimensions in px, from the font size in `touch_selection.html`.
constexpr int kCharacterWidth =;
constexpr int kCharacterHeight =;

bool JSONToPoint(const std::string& str, gfx::PointF* point) {}

gfx::RectF ConvertRectFToChildCoords(RenderWidgetHostViewAura* parent,
                                     RenderWidgetHostViewChildFrame* child,
                                     const gfx::RectF& rect) {}

// Converts a point from `view` coordinates to the coordinate system used by
// `generator_delegate`.
gfx::Point ConvertPointFromView(
    RenderWidgetHostViewAura* view,
    const ui::test::EventGeneratorDelegate* generator_delegate,
    const gfx::PointF& point_in_view) {}

// A mock touch selection menu runner to use whenever a default one is not
// installed.
class TestTouchSelectionMenuRunner : public ui::TouchSelectionMenuRunner {};

}  // namespace

class TestTouchSelectionControllerClientAura
    : public TouchSelectionControllerClientAura,
      public TextInputManager::Observer {};

class TouchSelectionControllerClientAuraTest : public ContentBrowserTest {};

IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       InitiallyInactive) {}

// Tests that long-pressing on a text brings up selection handles and the quick
// menu properly.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       LongPressSelection) {}

class TouchSelectionControllerClientAuraSiteIsolationTest
    : public TouchSelectionControllerClientAuraTest,
      public testing::WithParamInterface<bool> {};

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
                       BasicSelectionIsolatedIframe) {}

// Failing in sanitizer runs: https://crbug.com/1405296
IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
                       DISABLED_BasicSelectionIsolatedScrollMainframe) {}

// Tests that the selection handles in a child view have their bounds updated
// when the main view is resized.
IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
                       SelectionHandlesIsolatedIframeMainViewResized) {}

IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
                       TouchSelectionDeactivatedAfterReload) {}

// Tests that tapping in a textfield brings up the insertion handle, but not the
// quick menu, initially. Then, successive taps on the insertion handle toggle
// the quick menu visibility.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       BasicInsertionFollowedByTapsOnHandle) {}

#if BUILDFLAG(IS_CHROMEOS)
// Tests that the text selection can be adjusted by touch dragging after a long
// press gesture on readable text.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       LongPressDragSelectionReadableText) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Long pressing on readable text should select the closest word.
  gfx::Point point_in_readable_text = gfx::ToRoundedPoint(GetPointInText(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_readable_text);
  SelectWithLongPress(generator, point_in_readable_text);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(4 * kCharacterWidth, kCharacterHeight));

  // Drag after the long press to adjust the selection.
  InitiateTouchSelectionDragging(generator);

  // Move the end of the selection from "Some|" to "Some text|".
  DragAndWaitForSelectionUpdate(generator, 5 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some text");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(9 * kCharacterWidth, kCharacterHeight));

  // Move the end of the selection from "Some text|" to "Some t|".
  DragAndWaitForSelectionUpdate(generator, -3 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some t");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(6 * kCharacterWidth, kCharacterHeight));
}

// Tests that the text selection can be adjusted by touch dragging after a long
// press gesture on editable text.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       LongPressDragSelectionEditableText) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Long pressing on editable text should select the closest word.
  gfx::Point point_in_textfield = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_textfield);
  SelectWithLongPress(generator, point_in_textfield);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(4 * kCharacterWidth, kCharacterHeight));

  // Drag after the long press to adjust the selection.
  InitiateTouchSelectionDragging(generator);

  // Move the end of the selection from "Some|" to "Some editable|".
  DragAndWaitForSelectionUpdate(generator, 9 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editable");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(13 * kCharacterWidth, kCharacterHeight));

  // Drag the end of the selection from "Some editable|" to "Some editabl|".
  DragAndWaitForSelectionUpdate(generator, -kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editabl");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(12 * kCharacterWidth, kCharacterHeight));
}

// Tests that the text selection can be adjusted by touch dragging after a
// double press gesture on editable text.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       DoublePressDragSelection) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Double pressing on editable text should select the closest word.
  gfx::Point point_in_textfield = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_textfield);
  SelectWithDoublePress(generator, point_in_textfield);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(4 * kCharacterWidth, kCharacterHeight));

  // Drag after the double press to adjust the selection.
  InitiateTouchSelectionDragging(generator);

  // Move the end of the selection from "Some|" to "Some editable|".
  DragAndWaitForSelectionUpdate(generator, 9 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editable");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(13 * kCharacterWidth, kCharacterHeight));

  // Drag the end of the selection from "Some editable|" to "Some editabl|".
  DragAndWaitForSelectionUpdate(generator, -kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editabl");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(12 * kCharacterWidth, kCharacterHeight));
}

// Tests that touch selection dragging adjusts the selection using a direction
// strategy (roughly, expands by word and shrinks by character).
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectionDraggingDirectionStrategy) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Double press in editable text to select the closest word.
  gfx::Point point_in_textfield = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_textfield);
  SelectWithDoublePress(generator, point_in_textfield);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(4 * kCharacterWidth, kCharacterHeight));

  // Drag the end of the selection from "Some|" to "Some edita|". The selection
  // should expand to the closest word boundary. Note that this creates an
  // offset of 3 characters between the drag position and end of the selection.
  InitiateTouchSelectionDragging(generator);
  DragAndWaitForSelectionUpdate(generator, 6 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editable");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(13 * kCharacterWidth, kCharacterHeight));

  // Drag the end of the selection from "Some editable|" to "Some ed|". The
  // selection should shrink to the nearest character boundary, preserving the
  // offset between the drag position and end of the selection.
  DragAndWaitForSelectionUpdate(generator, -6 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some ed");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(7 * kCharacterWidth, kCharacterHeight));

  // Drag to remove the 3 character offset and move the end of the selection
  // from "Some ed|" to "Some edit|". Since we are adjusting within a word, the
  // selection expands with character granularity.
  DragAndWaitForSelectionUpdate(generator, 5 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some edit");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(9 * kCharacterWidth, kCharacterHeight));

  // Drag the end of the selection from "Some edit|" to "Some editable tex|".
  // Since we have expanded past a word boundary, the selection should expand
  // with word granularity again.
  DragAndWaitForSelectionUpdate(generator, 8 * kCharacterWidth, 0);
  EXPECT_EQ(rwhva->GetSelectedText(), u"Some editable text");
  EXPECT_EQ(rwhva->selection_controller()->GetRectBetweenBounds().size(),
            gfx::SizeF(18 * kCharacterWidth, kCharacterHeight));
}

// Tests that a magnifier is shown when touch selection dragging.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectionDraggingShowsMagnifier) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Double press in textfield then start touch selection dragging.
  gfx::Point point_in_textfield = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_textfield);
  SelectWithDoublePress(generator, point_in_textfield);
  InitiateTouchSelectionDragging(generator);

  // Drag to move the selection.
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::SELECTION_HANDLES_MOVED);
  generator.MoveTouchBy(8 * kCharacterWidth, 0);
  selection_controller_client()->Wait();
  // Magnifier should be shown while dragging.
  EXPECT_TRUE(selection_controller_client()->IsMagnifierVisible());

  // Release touch to end the drag.
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::SELECTION_HANDLE_DRAG_STOPPED);
  generator.ReleaseTouch();
  selection_controller_client()->Wait();
  // Magnifier should be hidden after dragging stops.
  EXPECT_FALSE(selection_controller_client()->IsMagnifierVisible());
}

// Tests that tapping the caret toggles showing and hiding the quick menu.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest, TapOnCaret) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));
  InitSelectionController(true);

  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  const gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Mouse click inside the textfield to make a caret appear.
  selection_controller_client()->InitWaitForSelectionUpdate();
  gfx::Point point = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view, &point);
  generator.MoveMouseTo(point);
  generator.PressLeftButton();
  selection_controller_client()->Wait();
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INACTIVE);
  EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());

  // Tap the caret to show an insertion handle and quick menu.
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::INSERTION_HANDLE_SHOWN);
  selection_controller_client()->InitWaitForHandleContextMenu();
  generator.GestureTapAt(point);
  // Wait for both the insertion handle to be shown and for the context menu
  // event to be handled, since these might not occur in a fixed order.
  selection_controller_client()->Wait();
  selection_controller_client()->WaitForHandleContextMenu();
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INSERTION_ACTIVE);
  EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());

  // Tap the caret again to hide the quick menu. We advance the clock before
  // tapping again to avoid the tap being treated as a double tap.
  generator.AdvanceClock(base::Milliseconds(1000));
  selection_controller_client()->InitWaitForHandleContextMenu();
  generator.GestureTapAt(point);
  selection_controller_client()->WaitForHandleContextMenu();
  // The insertion handle should still be shown but menu should be hidden.
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INSERTION_ACTIVE);
  EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());
}

// Tests that the insertion handle and menu are hidden when a mouse event
// occurs, then can be shown again by tapping on the caret.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       HandleVisibilityAfterMouseEvent) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));
  InitSelectionController(true);

  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  const gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());

  // Tap inside the textfield to place a caret and show an insertion handle.
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::INSERTION_HANDLE_SHOWN);
  gfx::Point caret_location = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view, &caret_location);
  generator.GestureTapAt(caret_location);
  selection_controller_client()->Wait();

  const gfx::RectF caret_bounds =
      rwhva->selection_controller()->GetVisibleRectBetweenBounds();
  EXPECT_NE(caret_bounds, gfx::RectF());
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INSERTION_ACTIVE);
  EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());

  // Move the mouse to hide the insertion handle.
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::INSERTION_HANDLE_CLEARED);
  generator.SendMouseEnter();
  generator.MoveMouseBy(100, 100);
  selection_controller_client()->Wait();

  EXPECT_EQ(rwhva->selection_controller()->GetVisibleRectBetweenBounds(),
            gfx::RectF());
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INACTIVE);
  EXPECT_FALSE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());

  // Tap the caret to show the menu and make the insertion handle reappear. We
  // advance the clock before tapping to avoid it being treated as a double tap.
  generator.AdvanceClock(base::Milliseconds(1000));
  selection_controller_client()->InitWaitForSelectionEvent(
      ui::INSERTION_HANDLE_SHOWN);
  generator.GestureTapAt(caret_location);
  selection_controller_client()->Wait();

  EXPECT_EQ(rwhva->selection_controller()->GetVisibleRectBetweenBounds(),
            caret_bounds);
  EXPECT_EQ(rwhva->selection_controller()->active_status(),
            ui::TouchSelectionController::INSERTION_ACTIVE);
  EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning());
}
#endif  // BUILDFLAG(IS_CHROMEOS)

#if BUILDFLAG(IS_CHROMEOS_ASH)
// Tests that touch selection dragging records a histogram entry.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectionDraggingMetrics) {
  // Set the test page up.
  ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/touch_selection.html"));

  base::HistogramTester histogram_tester;
  InitSelectionController(false);
  RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura();
  gfx::NativeView native_view = rwhva->GetNativeView();
  ui::test::EventGenerator generator(native_view->GetRootWindow());
  gfx::Point point_in_textfield = gfx::ToRoundedPoint(GetPointInTextfield(2));
  generator.delegate()->ConvertPointFromTarget(native_view,
                                               &point_in_textfield);

  // Long press drag selection.
  SelectWithLongPress(generator, point_in_textfield);
  InitiateTouchSelectionDragging(generator);
  DragAndWaitForSelectionUpdate(generator, 9 * kCharacterWidth, 0);
  generator.ReleaseTouch();
  histogram_tester.ExpectBucketCount(ui::kTouchSelectionDragTypeHistogramName,
                                     ui::TouchSelectionDragType::kLongPressDrag,
                                     1);
  histogram_tester.ExpectTotalCount(ui::kTouchSelectionDragTypeHistogramName,
                                    1);

  // Double press drag selection. Close the menu if needed so that it doesn't
  // get in the way of the double press.
  ui::TouchSelectionMenuRunner::GetInstance()->CloseMenu();
  SelectWithDoublePress(generator, point_in_textfield);
  InitiateTouchSelectionDragging(generator);
  DragAndWaitForSelectionUpdate(generator, 10 * kCharacterWidth, 0);
  generator.ReleaseTouch();
  histogram_tester.ExpectBucketCount(
      ui::kTouchSelectionDragTypeHistogramName,
      ui::TouchSelectionDragType::kDoublePressDrag, 1);
  histogram_tester.ExpectTotalCount(ui::kTouchSelectionDragTypeHistogramName,
                                    2);

  // Start typing to end the touch selection session.
  generator.PressAndReleaseKey(ui::VKEY_A);
  histogram_tester.ExpectUniqueSample(
      ui::kTouchSelectionSessionTouchDownCountHistogramName, 3, 1);
}
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

// Tests that the quick menu is hidden whenever a touch point is active.
// Flaky: https://crbug.com/803576
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       DISABLED_QuickMenuHiddenOnTouch) {}

// Tests that the quick menu and touch handles are hidden during an scroll.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest, HiddenOnScroll) {}

// Tests that the magnifier is correctly shown for a swipe-to-move-cursor
// gesture.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SwipeToMoveCursorMagnifier) {}

// Tests that the select all menu command works correctly.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectAllCommand) {}

// Tests that the select word menu command works correctly.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectWordCommand) {}

// Tests that the select all and select word commands in the quick menu are
// disabled for empty textfields.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraTest,
                       SelectCommandsEmptyTextfield) {}

class TouchSelectionControllerClientAuraScaleFactorTest
    : public TouchSelectionControllerClientAuraTest {};

// Tests that selection handles are properly positioned at 2x DSF.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       SelectionHandleCoordinates) {}

// Tests that selection handle coordinates are updated after dragging at 2x DSF.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       SelectionHandleCoordinatesAfterDrag) {}

// Tests that the menu is correctly shown after dragging a selection handle.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       SelectionHandleDragShowsMenu) {}

// Tests that the magnifier is correctly shown when dragging a selection handle.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       SelectionHandleDragShowsMagnifier) {}

// Tests that insertion handles are properly positioned at 2x DSF.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       InsertionHandleCoordinates) {}

// Tests that the magnifier is correctly shown when dragging a insertion handle.
IN_PROC_BROWSER_TEST_F(TouchSelectionControllerClientAuraScaleFactorTest,
                       InsertionHandleDragShowsMagnifier) {}

}  // namespace content