#include "ui/wm/core/focus_controller.h"
#include <map>
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
#include "ui/events/test/event_generator.h"
#include "ui/wm/core/base_focus_rules.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_change_observer.h"
#include "ui/wm/public/activation_client.h"
#if DCHECK_IS_ON()
#define EXPECT_DCHECK(statement, regex) …
#else
#define EXPECT_DCHECK …
#endif
namespace wm {
class FocusNotificationObserver : public ActivationChangeObserver,
public aura::client::FocusChangeObserver { … };
class WindowDeleter { … };
class RecordingActivationAndFocusChangeObserver
: public ActivationChangeObserver,
public aura::client::FocusChangeObserver { … };
class HideOnLoseActivationChangeObserver : public ActivationChangeObserver { … };
class DeleteOnActivationChangeObserver : public ActivationChangeObserver,
public WindowDeleter { … };
class DeleteOnLoseFocusChangeObserver
: public aura::client::FocusChangeObserver,
public WindowDeleter { … };
class ScopedFocusNotificationObserver : public FocusNotificationObserver { … };
class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver { … };
class SimpleEventHandler : public ui::EventHandler { … };
class FocusShiftingActivationObserver : public ActivationChangeObserver { … };
class ActivateWhileActivatingObserver : public ActivationChangeObserver { … };
class TestFocusRules : public BaseFocusRules { … };
class FocusControllerTestBase : public aura::test::AuraTestBase { … };
class FocusControllerDirectTestBase : public FocusControllerTestBase { … };
class FocusControllerApiTest : public FocusControllerDirectTestBase { … };
class FocusControllerMouseEventTest : public FocusControllerDirectTestBase { … };
class FocusControllerMouseEnterEventTest
: public FocusControllerMouseEventTest { … };
class FocusControllerGestureEventTest : public FocusControllerDirectTestBase { … };
class FocusControllerImplicitTestBase : public FocusControllerTestBase { … };
class FocusControllerHideTest : public FocusControllerImplicitTestBase { … };
class FocusControllerParentHideTest : public FocusControllerHideTest { … };
class FocusControllerDestructionTest : public FocusControllerImplicitTestBase { … };
class FocusControllerParentDestructionTest
: public FocusControllerDestructionTest { … };
class FocusControllerRemovalTest : public FocusControllerImplicitTestBase { … };
class FocusControllerParentRemovalTest : public FocusControllerRemovalTest { … };
#define FOCUS_CONTROLLER_TEST(TESTCLASS, TESTNAME) …
#define DIRECT_FOCUS_CHANGE_TESTS(TESTNAME) …
#define IMPLICIT_FOCUS_CHANGE_TARGET_TESTS(TESTNAME) …
#define IMPLICIT_FOCUS_CHANGE_PARENT_TESTS(TESTNAME) …
#define IMPLICIT_FOCUS_CHANGE_TESTS(TESTNAME) …
#define ALL_FOCUS_TESTS(TESTNAME) …
#define TARGET_FOCUS_TESTS(TESTNAME) …
ALL_FOCUS_TESTS(BasicFocus)
TARGET_FOCUS_TESTS(BasicActivation)
ALL_FOCUS_TESTS(FocusEvents)
DIRECT_FOCUS_CHANGE_TESTS(DuplicateFocusEvents)
DIRECT_FOCUS_CHANGE_TESTS(DuplicateActivationEvents)
TARGET_FOCUS_TESTS(ActivationEvents)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest, ReactivationEvents)
DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusWithinActiveWindow)
DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusToChildOfInactiveWindow)
DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusToParentOfFocusedWindow)
ALL_FOCUS_TESTS(FocusRulesOverride)
TARGET_FOCUS_TESTS(ActivationRulesOverride)
DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivation)
DIRECT_FOCUS_CHANGE_TESTS(ShiftFocusOnActivationDueToHide)
DIRECT_FOCUS_CHANGE_TESTS(NoShiftActiveOnActivation)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest, FocusChangeDuringDrag)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest,
ChangeFocusWhenNothingFocusedAndCaptured)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest, DontPassDeletedWindow)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest, StackWindowAtTopOnActivation)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest,
HideFocusedWindowDuringActivationLoss)
FOCUS_CONTROLLER_TEST(FocusControllerApiTest, ActivateWhileActivating)
FOCUS_CONTROLLER_TEST(FocusControllerParentHideTest,
TransientChildWindowActivationTest)
FOCUS_CONTROLLER_TEST(FocusControllerMouseEventTest, IgnoreHandledEvent)
FOCUS_CONTROLLER_TEST(FocusControllerMouseEnterEventTest, MouseEnteredEvent)
FOCUS_CONTROLLER_TEST(FocusControllerMouseEnterEventTest,
MouseEnteredWithActiveParent)
}