chromium/chrome/test/supervised_user/api_mock_setup_mixin.cc

// Copyright 2023 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/test/supervised_user/api_mock_setup_mixin.h"

#include <string>
#include <string_view>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "components/supervised_user/test_support/kids_management_api_server_mock.h"
#include "net/dns/mock_host_resolver.h"
#include "services/network/public/cpp/network_switches.h"

namespace supervised_user {

namespace {
constexpr std::string_view kKidsManagementServiceEndpoint{};

// Self-consistent conditional RAII lock on list family members load.
//
// Registers to observe a preference and blocks until it is loaded for
// *supervised users* (see ~FamilyFetchedLock() and IsSupervisedProfile()).
// Effectivelly, halts the main testing thread until the first fetch of list
// family members has finished, which is typically invoked by the browser after
// startup of the SupervisedUserService.
//
// For non-supervised users, this is no-op (it just registers and unregisters a
// preference observer).
class FamilyFetchedLock {};
}  // namespace

KidsManagementApiMockSetupMixin::KidsManagementApiMockSetupMixin(
    InProcessBrowserTestMixinHost& host,
    InProcessBrowserTest* test_base)
    :{}
KidsManagementApiMockSetupMixin::~KidsManagementApiMockSetupMixin() = default;

void KidsManagementApiMockSetupMixin::SetUp() {}

void KidsManagementApiMockSetupMixin::SetUpCommandLine(
    base::CommandLine* command_line) {}

void KidsManagementApiMockSetupMixin::SetUpOnMainThread() {}

void KidsManagementApiMockSetupMixin::TearDownOnMainThread() {}

}  // namespace supervised_user