#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/screen_ai/screen_ai_install_state.h"
#include "chrome/browser/screen_ai/screen_ai_service_router.h"
#include "chrome/browser/screen_ai/screen_ai_service_router_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "content/public/test/browser_test.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/dns/mock_host_resolver.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/screen_ai/buildflags/buildflags.h"
#include "services/screen_ai/public/cpp/utilities.h"
#include "services/screen_ai/public/mojom/screen_ai_service.mojom.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_features.mojom-features.h"
namespace {
#if !BUILDFLAG(USE_FAKE_SCREEN_AI)
const constexpr char* kTestPageRelativeURL = …;
const constexpr char* kExpectedText = …;
bool HasExpectedText(const std::vector<ui::AXNodeData>& tree_nodes,
std::vector<ui::AXNodeID> ids) { … }
#endif
}
namespace screen_ai {
class MainContentExtractionTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(MainContentExtractionTest, EmptyInput) { … }
#if !BUILDFLAG(USE_FAKE_SCREEN_AI)
IN_PROC_BROWSER_TEST_F(MainContentExtractionTest, RequestWithContent) { … }
IN_PROC_BROWSER_TEST_F(MainContentExtractionTest, MultipleRequests) { … }
#endif
}