chromium/ui/views/accessibility/view_ax_platform_node_delegate_unittest.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 "ui/views/accessibility/view_ax_platform_node_delegate.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gtest_util.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_selection.h"
#include "ui/accessibility/platform/ax_platform_for_test.h"
#include "ui/accessibility/platform/ax_platform_node.h"
#include "ui/accessibility/platform/ax_platform_node_base.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/table_model.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/controls/menu/test_menu_item_view.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/table/table_view.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/test/menu_test_utils.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"

#if defined(USE_AURA)
#include "ui/views/accessibility/ax_aura_obj_cache.h"
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
#include "ui/views/accessibility/ax_event_manager.h"
#include "ui/views/accessibility/ax_event_observer.h"
#include "ui/views/accessibility/ax_widget_obj_wrapper.h"
#endif

namespace views::test {

namespace {

class TestButton : public Button {};

BEGIN_METADATA()

#if defined(USE_AURA)
class TestAXEventObserver : public AXEventObserver {};
#endif

}  // namespace

class TestTableModel : public ui::TableModel {};

class ViewAXPlatformNodeDelegateTest : public ViewsTestBase {};

class ViewAXPlatformNodeDelegateTableTest
    : public ViewAXPlatformNodeDelegateTest {};

class ViewAXPlatformNodeDelegateMenuTest
    : public ViewAXPlatformNodeDelegateTest {};

TEST_F(ViewAXPlatformNodeDelegateTest, FocusBehaviorShouldAffectIgnoredState) {}

TEST_F(ViewAXPlatformNodeDelegateTest, BoundsShouldMatch) {}

TEST_F(ViewAXPlatformNodeDelegateTest, LabelIsChildOfButton) {}

// Verify Views with invisible ancestors have ax::mojom::State::kInvisible.
TEST_F(ViewAXPlatformNodeDelegateTest, InvisibleViews) {}

// Verify Views with invisible ancestors have correct values for
// IsInvisibleOrIgnored().
TEST_F(ViewAXPlatformNodeDelegateTest, IsInvisibleOrIgnored) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetFocus) {}

TEST_F(ViewAXPlatformNodeDelegateTest, GetAuthorUniqueIdDefault) {}

TEST_F(ViewAXPlatformNodeDelegateTest, GetAuthorUniqueIdNonDefault) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetNameAndDescription) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetIsSelected) {}

TEST_F(ViewAXPlatformNodeDelegateTest, IsOrderedSet) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetSizeAndPosition) {}

TEST_F(ViewAXPlatformNodeDelegateTest, TreeNavigation) {}

TEST_F(ViewAXPlatformNodeDelegateTest, ComputeViewListItemName) {}

TEST_F(ViewAXPlatformNodeDelegateTest, TreeNavigationWithLeafViews) {}

TEST_F(ViewAXPlatformNodeDelegateTest, TreeNavigationWithIgnoredViews) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetIsEnabled) {}

TEST_F(ViewAXPlatformNodeDelegateTest, SetHasPopup) {}

TEST_F(ViewAXPlatformNodeDelegateTest, FocusOnMenuClose) {}

TEST_F(ViewAXPlatformNodeDelegateTest, GetUnignoredSelection) {}

TEST_F(ViewAXPlatformNodeDelegateTableTest, TableHasHeader) {}

TEST_F(ViewAXPlatformNodeDelegateTableTest, TableHasCell) {}

TEST_F(ViewAXPlatformNodeDelegateMenuTest, MenuTest) {}

#if defined(USE_AURA)
class DerivedTestView : public View {};

BEGIN_METADATA()

AXViewTest;

// Check if the destruction of the widget ends successfully if |view|'s
// visibility changed during destruction.
TEST_F(AXViewTest, LayoutCalledInvalidateRootView) {}
#endif

}  // namespace views::test