chromium/ui/views/controls/tree/tree_view_unittest.cc

// Copyright 2012 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/controls/tree/tree_view.h"

#include <numeric>
#include <string>
#include <utility>
#include <vector>

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_node_id_forward.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
#include "ui/base/models/tree_node_model.h"
#include "ui/compositor/canvas_painter.h"
#include "ui/views/accessibility/ax_virtual_view.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/accessibility/view_ax_platform_node_delegate.h"
#include "ui/views/controls/prefix_selector.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/tree/tree_view_controller.h"
#include "ui/views/test/view_metadata_test_utils.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/unique_widget_ptr.h"
#include "ui/views/widget/widget.h"

TreeModel;
TreeModelNode;
TreeNode;

ASCIIToUTF16;

namespace views {

namespace {

std::string AccessibilityViewAsString(const AXVirtualView& view) {}

}  // namespace

class TestNode : public TreeNode<TestNode> {};

// Creates the following structure:
// 'root'
//   'a'
//   'b'
//     'b1'
//   'c'
class TreeViewTest : public ViewsTestBase {};

void TreeViewTest::SetUp() {}

void TreeViewTest::TearDown() {}

void TreeViewTest::ClearAccessibilityEvents() {}

TestNode* TreeViewTest::Add(TestNode* parent,
                            size_t index,
                            const std::string& title) {}

std::string TreeViewTest::TreeViewContentsAsString() {}

std::string TreeViewTest::TreeViewAccessibilityContentsAsString() const {}

std::string TreeViewTest::GetSelectedNodeTitle() {}

std::string TreeViewTest::GetSelectedAccessibilityViewName() const {}

std::string TreeViewTest::GetActiveNodeTitle() {}

std::string TreeViewTest::GetActiveAccessibilityViewName() const {}

std::string TreeViewTest::GetEditingNodeTitle() {}

AXVirtualView* TreeViewTest::GetRootAccessibilityView() const {}

ViewAXPlatformNodeDelegate* TreeViewTest::GetTreeAccessibilityView() const {}

TestNode* TreeViewTest::GetNodeByTitle(const std::string& title) {}

const AXVirtualView* TreeViewTest::GetAccessibilityViewByName(
    const std::string& name) const {}

void TreeViewTest::IncrementSelection(bool next) {}

void TreeViewTest::CollapseOrSelectParent() {}

void TreeViewTest::ExpandOrSelectChild() {}

size_t TreeViewTest::GetRowCount() {}

TestNode* TreeViewTest::GetNodeByTitleImpl(TestNode* node,
                                           const std::u16string& title) {}

std::string TreeViewTest::InternalNodeAsString(TreeView::InternalNode* node) {}

// Verify properties are accessible via metadata.
TEST_F(TreeViewTest, MetadataTest) {}

TEST_F(TreeViewTest, TreeViewPaintCoverage) {}

TEST_F(TreeViewTest, InitialAccessibilityProperties) {}

// Verifies setting model correctly updates internal state.
TEST_F(TreeViewTest, SetModel) {}

// Verifies that SetSelectedNode works.
TEST_F(TreeViewTest, SetSelectedNode) {}

// Makes sure SetRootShown doesn't blow up.
TEST_F(TreeViewTest, HideRoot) {}

// Expands a node and verifies the children are loaded correctly.
TEST_F(TreeViewTest, Expand) {}

// Collapse a node and verifies state.
TEST_F(TreeViewTest, Collapse) {}

// Verifies that adding nodes works.
TEST_F(TreeViewTest, TreeNodesAdded) {}

// Verifies that removing nodes works.
TEST_F(TreeViewTest, TreeNodesRemoved) {}

class TestController : public TreeViewController {};

TEST_F(TreeViewTest, RemovingLastNodeNotifiesSelectionChanged) {}

// Verifies that changing a node title works.
TEST_F(TreeViewTest, TreeNodeChanged) {}

// Verifies that IncrementSelection() works.
TEST_F(TreeViewTest, IncrementSelection) {}

// Verifies that CollapseOrSelectParent works.
TEST_F(TreeViewTest, CollapseOrSelectParent) {}

// Verifies that ExpandOrSelectChild works.
TEST_F(TreeViewTest, ExpandOrSelectChild) {}

// Verify that selection is properly updated on each keystroke.
TEST_F(TreeViewTest, SelectOnKeyStroke) {}

// Verifies that edits are committed when focus is lost.
TEST_F(TreeViewTest, CommitOnFocusLost) {}

// Verifies that virtual accessible actions go to virtual view targets.
TEST_F(TreeViewTest, VirtualAccessibleAction) {}

// Verifies that accessibility focus events get fired for the correct nodes when
// the tree view is given focus.
TEST_F(TreeViewTest, OnFocusAccessibilityEvents) {}

}  // namespace views