chromium/third_party/blink/renderer/core/editing/commands/move_commands_test.cc

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

#include <string>

#include "build/build_config.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/editing/commands/move_commands.h"
#include "third_party/blink/renderer/core/editing/editing_behavior.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/editing/frame_selection.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/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"

namespace blink {

class MoveCommandsTest : public EditingTestBase {};

// The following CaretBrowsingPositionAndFocusUpdate_Move* tests verify that the
// move commands are using UpdateFocusForCaretBrowsing to adjust caret position
// and focus while caret browsing.

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveBackward) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveDown) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveForward) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveLeft) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveParagraphBackward) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveParagraphForward) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveRight) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToBeginningOfDocument) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToBeginningOfLine) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToBeginningOfParagraph) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToBeginningOfSentence) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToEndOfDocument) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveToEndOfLine) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToEndOfParagraph) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToEndOfSentence) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToLeftEndOfLine) {}

TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveToRightEndOfLine) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveUp) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveWordBackward) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveWordForward) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveWordLeft) {}

TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_MoveWordRight) {}

// This test verifies that focus returns to the body after browsing out of a
// focusable element.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_ExitingFocusableElement) {}

// This test verifies that caret browsing into a focusable element does not
// move focus if inside an editable region.
TEST_F(MoveCommandsTest, CaretBrowsingPositionAndFocusUpdate_EditableElements) {}

// This test verifies that another focusable element (the button element) can be
// moved into while caret browsing and gains focus, just like an anchor
// element.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveRightButtonElement) {}

// This test verifies that an element with tabindex set can be moved
// into while caret browsing and gains focus, just like an anchor element.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveRightElementWithTabIndex) {}

// This test verifies that an input element will be skipped when caret browsing
// and not gain focus.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveRightInputElement) {}

// This test verifies that a contentEditable element will be skipped when caret
// browsing and not gain focus.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveRightContentEditableElement) {}

// This test verifies that a textarea element will be skipped when caret
// browsing and not gain focus.
TEST_F(MoveCommandsTest,
       CaretBrowsingPositionAndFocusUpdate_MoveRightTextAreaElement) {}

// This test verifies that while caret browsing if you try to move the caret
// when it is not in focus then it jumps to the active element before moving.
TEST_F(MoveCommandsTest, CaretBrowsingSelectionUpdate) {}

}  // namespace blink