chromium/services/screen_ai/proto/main_content_extractor_proto_convertor_unittest.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "services/screen_ai/proto/main_content_extractor_proto_convertor.h"

#include <string_view>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/test/test_proto_loader.h"
#include "build/build_config.h"
#include "services/screen_ai/proto/view_hierarchy.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree.h"
#include "ui/accessibility/ax_tree_update.h"

namespace {

// To update the test expectations:
//  1- Set the following to 'true' to get debug protos.
//  2- Replace the expected proto by the generated file.
#define WRITE_DEBUG_PROTO

// A dummy tree node definition for PreOrderTreeGeneration.
constexpr int kMaxChildInTemplate =;
struct NodeTemplate {};

ui::AXTreeUpdate CreateAXTreeUpdateFromTemplate(int root_id,
                                                NodeTemplate* nodes_template,
                                                int nodes_count) {}

int GetAxNodeID(const ::screenai::UiElement& ui_element) {}

base::FilePath GetTestFilePath(std::string_view file_name) {}

void WriteDebugProto(const std::string& serialized_proto,
                     const std::string& file_name) {}

std::string ConvertProtoToText(const std::string& proto_binary) {}

ui::AXTree CreateSampleTree() {}

}  // namespace

namespace screen_ai {

MainContentExtractorProtoConvertorTest;

// Tests if the given tree is properly traversed and new ids are assigned.
TEST_F(MainContentExtractorProtoConvertorTest, PreOrderTreeGeneration) {}

TEST_F(MainContentExtractorProtoConvertorTest, ProtoTest) {}

}  // namespace screen_ai