chromium/chrome/browser/chrome_multiprofile_startup_browsertest.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.

#include <vector>

#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/profiles/profile_picker.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/prefs/pref_service.h"
#include "content/public/test/browser_test.h"
#include "testing/gmock/include/gmock/gmock.h"

_;
InSequence;
Matcher;
Mock;
Property;
ValuesIn;

#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
#error Not supported on this platform.
#endif

namespace {

class MockMainExtraParts : public ChromeBrowserMainExtraParts {};

const char kOtherProfileDirPath[] =;

MATCHER_P(BaseNameEquals,
          basename,
          base::StrCat({}

Matcher<Profile*> HasBaseName(const char* basename) {}

struct MultiProfileStartupTestParam {};

const MultiProfileStartupTestParam kTestParams[] =;

// Creates a new profile to be picked up on the actual test.
void SetUpSecondaryProfileForPreTest(
    const base::FilePath& profile_dir_basename) {}

void CreateBrowserForProfileDir(const base::FilePath& profile_dir_basename) {}

}  // namespace

class ChromeMultiProfileStartupBrowserTestBase
    : public InProcessBrowserTest,
      public testing::WithParamInterface<MultiProfileStartupTestParam> {};

IN_PROC_BROWSER_TEST_P(ChromeMultiProfileStartupBrowserTestBase,
                       PRE_PostProfileInitInvocation) {}

// Make sure that the second profile creation causes `PostProfileInit()` to be
// called a second time.
IN_PROC_BROWSER_TEST_P(ChromeMultiProfileStartupBrowserTestBase,
                       PostProfileInitInvocation) {}

INSTANTIATE_TEST_SUITE_P();