#include "chrome/browser/profiles/profile_window.h"
#include <stddef.h>
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
#include "chrome/browser/ui/profiles/profile_picker.h"
#include "chrome/browser/ui/toolbar/app_menu_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/search_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/account_id/account_id.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service.h"
#include "components/search_engines/template_url_service.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#error "This test verifies the Desktop implementation of Guest only."
#endif
namespace {
class WaitForHistoryTask : public history::HistoryDBTask { … };
void WaitForHistoryBackendToRun(Profile* profile) { … }
class EmptyAcceleratorHandler : public ui::AcceleratorProvider { … };
}
class ProfileWindowBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, CountForNullBrowser) { … }
class ProfileWindowCountBrowserTest : public ProfileWindowBrowserTest,
public testing::WithParamInterface<bool> { … };
IN_PROC_BROWSER_TEST_P(ProfileWindowCountBrowserTest, CountProfileWindows) { … }
#if BUILDFLAG(IS_LINUX) && !defined(NDEBUG)
#define MAYBE_DevToolsWindowsNotCounted …
#else
#define MAYBE_DevToolsWindowsNotCounted …
#endif
IN_PROC_BROWSER_TEST_P(ProfileWindowCountBrowserTest,
MAYBE_DevToolsWindowsNotCounted) { … }
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, OpenGuestBrowser) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestIsOffTheRecord) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestIgnoresHistory) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestClearsCookies) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestClearsFindInPageCache) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestCannotSignin) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, GuestAppMenuLacksBookmarks) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest, OpenBrowserWindowForProfile) { … }
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest,
OpenTwoBrowserWindowsForProfile) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
#define MAYBE_OpenBrowserWindowForProfileWithSigninRequired …
#else
#define MAYBE_OpenBrowserWindowForProfileWithSigninRequired …
#endif
IN_PROC_BROWSER_TEST_F(ProfileWindowBrowserTest,
MAYBE_OpenBrowserWindowForProfileWithSigninRequired) { … }