chromium/chrome/browser/ui/views/profiles/profile_picker_view_test_utils.h

// 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.

#ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_PICKER_VIEW_TEST_UTILS_H_
#define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_PICKER_VIEW_TEST_UTILS_H_

#include <optional>

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ui/profiles/profile_picker.h"
#include "chrome/browser/ui/views/profiles/profile_management_flow_controller.h"
#include "chrome/browser/ui/views/profiles/profile_picker_view.h"
#include "chrome/browser/ui/views/profiles/profile_picker_web_contents_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/views/view_observer.h"

class Profile;
class ProfileManagementStepController;

namespace views {
class View;
}

// Waits until a view gets attached to its widget.
class ViewAddedWaiter : public views::ViewObserver {};

// Waits until a view is deleted.
class ViewDeletedWaiter : public ::views::ViewObserver {};

// Waits until `expected_url` is loaded in `web_view`. Supports the case when
// the page load happens in a different `content::WebContents` than the one
// displayed at the moment we start waiting.
class PickerLoadStopWaiter : public content::WebContentsObserver {};

// View intended to be used in pixel tests to render a specific step in the
// Profile Picker view.
// Unlike the classic `ProfilePickerView`, this one does not interact with the
// global state nor try to reuse previously existing views. It does not
// guarantee that some unsupported state can't be reached, so user discretion
// is advised.
class ProfileManagementStepTestView : public ProfilePickerView {};

#endif  // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_PICKER_VIEW_TEST_UTILS_H_