#ifdef UNSAFE_BUFFERS_BUILD
#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 {
#define WRITE_DEBUG_PROTO …
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 screen_ai {
MainContentExtractorProtoConvertorTest;
TEST_F(MainContentExtractorProtoConvertorTest, PreOrderTreeGeneration) { … }
TEST_F(MainContentExtractorProtoConvertorTest, ProtoTest) { … }
}