chromium/chrome/browser/accessibility/phrase_segmentation/dependency_parser_model_loader_browsertest.cc

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

#include "chrome/browser/accessibility/phrase_segmentation/dependency_parser_model_loader.h"

#include "base/base_paths.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/phrase_segmentation/dependency_parser_model_loader_factory.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "components/optimization_guide/core/model_util.h"
#include "components/optimization_guide/core/optimization_guide_test_util.h"
#include "components/optimization_guide/core/test_model_info_builder.h"
#include "components/optimization_guide/proto/models.pb.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/accessibility/accessibility_features.h"

namespace {

// Fetch and calculate the total number of samples from all the bins for
// |histogram_name|. Note: from some browertests run (such as chromeos) there
// might be two profiles created, and this will return the total sample count
// across profiles.
int GetTotalHistogramSamples(const base::HistogramTester* histogram_tester,
                             const std::string& histogram_name) {}

// Retries fetching |histogram_name| until it contains at least |count| samples.
int RetryForHistogramUntilCountReached(
    const base::HistogramTester* histogram_tester,
    const std::string& histogram_name,
    int count) {}

class DependencyParserModelLoaderDisabledBrowserTest
    : public InProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderDisabledBrowserTest,
                       DependencyParserModelLoaderDisabled) {}

class DependencyParserModelLoaderBrowserTest
    : public DependencyParserModelLoaderDisabledBrowserTest {};

base::FilePath model_file_path() {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       DependencyParserModelLoaderEnabled) {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       DependencyParserModelLoaderEnabled_OffTheRecord) {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       DependencyParserModelReadyOnRequest) {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       DependencyParserModelLoadedAfterRequest) {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       InvalidModelWhenLoading) {}

IN_PROC_BROWSER_TEST_F(DependencyParserModelLoaderBrowserTest,
                       ModelUpdateFromOptimizationGuide) {}

}  // namespace