chromium/ui/accessibility/ax_language_detection_unittest.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 "ui/accessibility/ax_language_detection.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "base/command_line.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/accessibility_switches.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node.h"
#include "ui/accessibility/ax_tree.h"

namespace ui {

const std::string kTextEnglish =;

const std::string kTextFrench =;

const std::string kTextGerman =;

const std::string kTextSpanish =;

// This test fixture is a friend of classes in ax_language_detection.h in order
// to enable testing of internals.
//
// When used with TEST_F, the test body is a subclass of this fixture, so we
// need to re-expose any members through this fixture in order for them to
// be accessible from within the test body.
class AXLanguageDetectionTestFixture : public testing::Test {};

class AXLanguageDetectionTestStaticContent
    : public AXLanguageDetectionTestFixture {};

class AXLanguageDetectionTestDynamicContent
    : public AXLanguageDetectionTestStaticContent {};

TEST_F(AXLanguageDetectionTestFixture, StaticContentFeatureFlag) {}

TEST_F(AXLanguageDetectionTestFixture, DynamicContentFeatureFlag) {}

TEST_F(AXLanguageDetectionTestFixture, FeatureFlag) {}

TEST(AXLanguageDetectionTest, LangAttrInheritanceFeatureFlagOff) {}

TEST(AXLanguageDetectionTest, LangAttrInheritanceFeatureFlagOn) {}

// Tests that AXNode::GetLanguage() terminates when there is no lang attribute.
TEST_F(AXLanguageDetectionTestStaticContent, GetLanguageBoringTree) {}

TEST_F(AXLanguageDetectionTestStaticContent, Basic) {}

TEST_F(AXLanguageDetectionTestStaticContent, MetricCollection) {}

TEST_F(AXLanguageDetectionTestStaticContent, DetectOnly) {}

TEST_F(AXLanguageDetectionTestStaticContent, kLanguageUntouched) {}

// Test RegisterLanguageDetectionObserver correctly respects the command line
// flags.
TEST_F(AXLanguageDetectionTestFixture, ObserverRegistrationObeysFlag) {}

// Test RegisterLanguageDetectionObserver correctly respects the feature flag.
TEST_F(AXLanguageDetectionTestFixture, ObserverRegistrationObeysFeatureFlag) {}

TEST_F(AXLanguageDetectionTestDynamicContent, Basic) {}

TEST_F(AXLanguageDetectionTestDynamicContent, MetricCollection) {}

TEST_F(AXLanguageDetectionTestDynamicContent, MultipleUpdates) {}

TEST_F(AXLanguageDetectionTestDynamicContent, NewRoot) {}

TEST_F(AXLanguageDetectionTestDynamicContent, ChainOfNewNodes) {}

TEST(AXLanguageDetectionTest, AXLanguageInfoStatsBasic) {}

TEST(AXLanguageDetectionTest, ShortLanguageDetectorLabeledTest) {}

TEST(AXLanguageDetectionTest, ShortLanguageDetectorCharacterTest) {}

TEST(AXLanguageDetectionTest, ShortLanguageDetectorMultipleLanguagesTest) {}

// Assert that GetLanguageAnnotationForStringAttribute works for attributes
// other than kName.
TEST(AXLanguageDetectionTest, DetectLanguagesForRoleTest) {}

}  // namespace ui