chromium/third_party/blink/renderer/modules/accessibility/ax_selection_test.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 "third_party/blink/renderer/modules/accessibility/ax_selection.h"

#include <string>

#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_focus_options.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.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/node.h"
#include "third_party/blink/renderer/core/dom/range.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/position.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/set_selection_options.h"
#include "third_party/blink/renderer/core/editing/text_affinity.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/html/html_br_element.h"
#include "third_party/blink/renderer/core/html/html_div_element.h"
#include "third_party/blink/renderer/core/html/html_paragraph_element.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/renderer/modules/accessibility/ax_position.h"
#include "third_party/blink/renderer/modules/accessibility/testing/accessibility_selection_test.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {
namespace test {

//
// Basic tests.
//

TEST_F(AccessibilitySelectionTest, FromCurrentSelection) {}

TEST_F(AccessibilitySelectionTest, FromCurrentSelectionSelectAll) {}

TEST_F(AccessibilitySelectionTest, ClearCurrentSelection) {}

TEST_F(AccessibilitySelectionTest, CancelSelect) {}

TEST_F(AccessibilitySelectionTest, DocumentRangeMatchesSelection) {}

TEST_F(AccessibilitySelectionTest, SetSelectionInText) {}

TEST_F(AccessibilitySelectionTest, SetSelectionInMultilineTextarea) {}

TEST_F(AccessibilitySelectionTest, SetSelectionInTextWithWhiteSpace) {}

TEST_F(AccessibilitySelectionTest, SetSelectionAcrossLineBreak) {}

TEST_F(AccessibilitySelectionTest, SetSelectionAcrossLineBreakInEditableText) {}

//
// Get selection tests.
// Retrieving a selection with endpoints which have corresponding ignored
// objects in the accessibility tree, e.g. which are display:none, should shrink
// or extend the |AXSelection| to valid endpoints.
// Note: aria-describedby adds hidden target subtrees to the a11y tree as
// "ignored but included in tree".
//

TEST_F(AccessibilitySelectionTest, SetSelectionInDisplayNone) {}

//
// Set selection tests.
// Setting the selection from an |AXSelection| that has endpoints which are not
// present in the layout tree should shrink or extend the selection to visible
// endpoints.
//

TEST_F(AccessibilitySelectionTest, SetSelectionAroundListBullet) {}

//
// Tests that involve selection inside, outside, and spanning text controls.
//

TEST_F(AccessibilitySelectionTest, FromCurrentSelectionInTextField) {}

TEST_F(AccessibilitySelectionTest, FromCurrentSelectionInTextarea) {}

TEST_F(AccessibilitySelectionTest, FromCurrentSelectionInTextareaWithAffinity) {}

TEST_F(AccessibilitySelectionTest,
       FromCurrentSelectionInTextareaWithCollapsedSelectionAndAffinity) {}

TEST_F(AccessibilitySelectionTest,
       FromCurrentSelectionInContentEditableWithSoftLineBreaks) {}

TEST_F(AccessibilitySelectionTest,
       FromCurrentSelectionInContentEditableSelectFirstSoftLineBreak) {}

TEST_F(AccessibilitySelectionTest,
       FromCurrentSelectionInContentEditableSelectFirstHardLineBreak) {}

TEST_F(AccessibilitySelectionTest, ClearCurrentSelectionInTextField) {}

TEST_F(AccessibilitySelectionTest, ClearCurrentSelectionInTextarea) {}

TEST_F(AccessibilitySelectionTest, ForwardSelectionInTextField) {}

TEST_F(AccessibilitySelectionTest, BackwardSelectionInTextField) {}

TEST_F(AccessibilitySelectionTest, SelectingTheWholeOfTheTextField) {}

TEST_F(AccessibilitySelectionTest, SelectEachConsecutiveCharacterInTextField) {}

TEST_F(AccessibilitySelectionTest,
       SelectEachConsecutiveCharacterInEmailFieldWithInvalidAddress) {}

TEST_F(AccessibilitySelectionTest, InvalidSelectionInTextField) {}

TEST_F(AccessibilitySelectionTest, ForwardSelectionInTextarea) {}

TEST_F(AccessibilitySelectionTest, BackwardSelectionInTextarea) {}

TEST_F(AccessibilitySelectionTest, SelectTheWholeOfTheTextarea) {}

TEST_F(AccessibilitySelectionTest, SelectEachConsecutiveCharacterInTextarea) {}

TEST_F(AccessibilitySelectionTest, InvalidSelectionInTextarea) {}

TEST_F(AccessibilitySelectionTest,
       FromCurrentSelectionInContenteditableWithAffinity) {}

TEST_F(AccessibilitySelectionTest,
       SelectEachConsecutiveCharacterInContenteditable) {}

TEST_F(AccessibilitySelectionTest, SelectionWithEqualBaseAndExtent) {}

TEST_F(AccessibilitySelectionTest, InvalidSelectionOnAShadowRoot) {}

//
// Declarative tests.
//

TEST_F(AccessibilitySelectionTest, ARIAHidden) {}

TEST_F(AccessibilitySelectionTest, List) {}

TEST_F(AccessibilitySelectionTest, ParagraphPresentational) {}

TEST_F(AccessibilitySelectionTest, SVG) {}

TEST_F(AccessibilitySelectionTest, Table) {}

}  // namespace test
}  // namespace blink