chromium/ui/views/selection_controller_unittest.cc

// 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 "ui/views/selection_controller.h"

#include <memory>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/render_text.h"
#include "ui/views/metrics.h"
#include "ui/views/selection_controller_delegate.h"
#include "ui/views/style/platform_style.h"

namespace views {
namespace {

const gfx::Point CenterLeft(const gfx::Rect& rect) {}

const gfx::Point CenterRight(const gfx::Rect& rect) {}

class TestSelectionControllerDelegate : public SelectionControllerDelegate {};

class SelectionControllerTest : public ::testing::Test {};

TEST_F(SelectionControllerTest, ClickAndDragToSelect) {}

TEST_F(SelectionControllerTest, RightClickWhenUnfocused) {}

TEST_F(SelectionControllerTest, RightClickSelectsWord) {}

// Regression test for https://crbug.com/856609
TEST_F(SelectionControllerTest, RightClickPastEndDoesntSelectLastWord) {}

// Regression test for https://crbug.com/731252
// This test validates that drags which are:
//   a) Above or below the text, and
//   b) Past one end of the text
// behave properly with regard to RenderText::kDragToEndIfOutsideVerticalBounds.
// When that option is true, drags outside the text that are horizontally
// "towards" the text should select all of it; when that option is false, those
// drags should have no effect.
TEST_F(SelectionControllerTest, DragPastEndUsesProperOrigin) {}

}  // namespace
}  // namespace views