chromium/third_party/blink/renderer/core/editing/frame_selection_test.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/editing/frame_selection.h"

#include <memory>
#include "base/memory/scoped_refptr.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_range.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/frame_caret.h"
#include "third_party/blink/renderer/core/editing/iterators/text_iterator.h"
#include "third_party/blink/renderer/core/editing/selection_controller.h"
#include "third_party/blink/renderer/core/editing/selection_modifier.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/testing/editing_test_base.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/layout/layout_block.h"
#include "third_party/blink/renderer/core/page/context_menu_controller.h"
#include "third_party/blink/renderer/core/paint/paint_info.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/testing/fake_display_item_client.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"

namespace blink {

IsNull;

class FrameSelectionTest : public EditingTestBase {};

Text* FrameSelectionTest::AppendTextNode(const String& data) {}

bool FrameSelectionTest::SelectWordAroundPosition(const Position& position) {}

bool FrameSelectionTest::SelectWordAroundCaret() {}

bool FrameSelectionTest::SelectSentenceAroundCaret() {}

TEST_F(FrameSelectionTest, FirstEphemeralRangeOf) {}

TEST_F(FrameSelectionTest, SetValidSelection) {}

#define EXPECT_EQ_SELECTED_TEXT(text)

TEST_F(FrameSelectionTest, SelectWordAroundCaret) {}

// crbug.com/657996
TEST_F(FrameSelectionTest, SelectWordAroundCaret2) {}

TEST_F(FrameSelectionTest, SelectAroundCaret_Word) {}

TEST_F(FrameSelectionTest, SelectAroundCaret_Sentence) {}

TEST_F(FrameSelectionTest, SelectAroundCaret_ShouldShowHandle) {}

TEST_F(FrameSelectionTest, SelectAroundCaret_ShouldShowContextMenu) {}

TEST_F(FrameSelectionTest, GetSelectionRangeAroundCaret_Word) {}

TEST_F(FrameSelectionTest, GetSelectionRangeAroundCaret_Sentence) {}

TEST_F(FrameSelectionTest, ModifyExtendWithFlatTree) {}

TEST_F(FrameSelectionTest, ModifyWithUserTriggered) {}

TEST_F(FrameSelectionTest, MoveRangeSelectionTest) {}

TEST_F(FrameSelectionTest, MoveRangeSelectionNoLiveness) {}

// For http://crbug.com/695317
TEST_F(FrameSelectionTest, SelectAllWithInputElement) {}

TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot) {}

TEST_F(FrameSelectionTest, SelectAllPreservesHandle) {}

TEST_F(FrameSelectionTest, BoldCommandPreservesHandle) {}

TEST_F(FrameSelectionTest, SelectionOnRangeHidesHandles) {}

// Regression test for crbug.com/702756
// Test case excerpted from editing/undo/redo_correct_selection.html
TEST_F(FrameSelectionTest, SelectInvalidPositionInFlatTreeDoesntCrash) {}

TEST_F(FrameSelectionTest, CaretInShadowTree) {}

TEST_F(FrameSelectionTest, CaretInTextControl) {}

TEST_F(FrameSelectionTest, RangeInShadowTree) {}

TEST_F(FrameSelectionTest, RangeInTextControl) {}

// crbug.com/692898
TEST_F(FrameSelectionTest, FocusingLinkHidesCaretInTextControl) {}

// crbug.com/692898
TEST_F(FrameSelectionTest, FocusingLinkHidesRangeInTextControl) {}

TEST_F(FrameSelectionTest, FocusingButtonHidesRangeInReadOnlyTextControl) {}

TEST_F(FrameSelectionTest, FocusingButtonHidesRangeInDisabledTextControl) {}

// crbug.com/713051
TEST_F(FrameSelectionTest, FocusingNonEditableParentHidesCaretInTextControl) {}

// crbug.com/713051
TEST_F(FrameSelectionTest, FocusingNonEditableParentHidesRangeInTextControl) {}

TEST_F(FrameSelectionTest, CaretInEditableDiv) {}

TEST_F(FrameSelectionTest, RangeInEditableDiv) {}

TEST_F(FrameSelectionTest, RangeInEditableDivInShadowTree) {}

TEST_F(FrameSelectionTest, FocusingLinkHidesCaretInContentEditable) {}

TEST_F(FrameSelectionTest, FocusingLinkKeepsRangeInContentEditable) {}

TEST_F(FrameSelectionTest, FocusingEditableParentKeepsEditableCaret) {}

TEST_F(FrameSelectionTest, FocusingEditableParentKeepsEditableRange) {}

TEST_F(FrameSelectionTest, FocusingNonEditableParentHidesEditableCaret) {}

TEST_F(FrameSelectionTest, FocusingNonEditableParentKeepsEditableRange) {}

// crbug.com/707143
TEST_F(FrameSelectionTest, RangeContainsFocus) {}

// crbug.com/707143
TEST_F(FrameSelectionTest, RangeOutsideFocus) {}

// crbug.com/725457
TEST_F(FrameSelectionTest, InconsistentVisibleSelectionNoCrash) {}

TEST_F(FrameSelectionTest, SelectionBounds) {}

TEST_F(FrameSelectionTest, AbosluteSelectionBoundsAfterScroll) {}

TEST_F(FrameSelectionTest, SelectionContainsBidiBoundary) {}

// This is a regression test for https://crbug.com/927394 where 'copy' operation
// stopped copying content from inside text controls.
// Note that this is a non-standard behavior.
TEST_F(FrameSelectionTest, SelectedTextForClipboardEntersTextControls) {}

// For https://crbug.com/1177295
TEST_F(FrameSelectionTest, PositionDisconnectedInFlatTree) {}

TEST_F(FrameSelectionTest, PaintCaretRecordsSelectionWithNoSelectionHandles) {}

}  // namespace blink