chromium/ui/accessibility/ax_tree_source_checker_unittest.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 "ui/accessibility/ax_tree_source_checker.h"

#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree_data.h"
#include "ui/accessibility/ax_tree_source.h"

namespace ui {
namespace {

struct FakeAXNode {};

// It's distracting to see an empty bounding box from every node, so do a
// search-and-replace to get rid of those strings.
void CleanAXNodeDataString(std::string* error_str) {}

// A simple implementation of AXTreeSource initialized from a simple static
// vector of node data, where both the child and parent connections are
// explicit. This allows us to test that AXTreeSourceChecker properly warns
// about errors in accessibility trees that have inconsistent parent/child
// links.
class FakeAXTreeSource
    : public AXTreeSource<const FakeAXNode*, AXTreeData*, AXNodeData> {};

}  // namespace

FakeAXTreeSourceChecker;

TEST(AXTreeSourceCheckerTest, SimpleValidTree) {}

TEST(AXTreeSourceCheckerTest, BadRoot) {}

TEST(AXTreeSourceCheckerTest, BadNodeIdOfRoot) {}

TEST(AXTreeSourceCheckerTest, BadNodeIdOfChild) {}

TEST(AXTreeSourceCheckerTest, RootShouldNotBeNodeWithParent) {}

TEST(AXTreeSourceCheckerTest, MissingParent) {}

TEST(AXTreeSourceCheckerTest, InvalidParent) {}

}  // namespace ui