#include "extensions/shell/browser/shell_desktop_controller_aura.h"
#include <memory>
#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_client.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/app_window/native_app_window.h"
#include "extensions/browser/app_window/test_app_window_contents.h"
#include "extensions/common/extension_builder.h"
#include "extensions/shell/browser/shell_app_delegate.h"
#include "extensions/shell/test/shell_test_base_aura.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/dummy_text_input_client.h"
#include "ui/base/ime/init/input_method_factory.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/input_method_minimal.h"
#include "ui/display/display.h"
#include "ui/display/screen_base.h"
#include "ui/events/event.h"
#include "ui/events/event_dispatcher.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/geometry/rect.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/power/fake_power_manager_client.h"
#endif
#if BUILDFLAG(IS_OZONE)
#include "ui/events/ozone/events_ozone.h"
#endif
namespace extensions {
class ShellDesktopControllerAuraTest : public ShellTestBaseAura { … };
#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ShellDesktopControllerAuraTest, PowerButton) {
auto* power_manager_client = chromeos::FakePowerManagerClient::Get();
power_manager_client->SendPowerButtonEvent(false ,
base::TimeTicks());
EXPECT_EQ(0, power_manager_client->num_request_shutdown_calls());
power_manager_client->SendPowerButtonEvent(true ,
base::TimeTicks());
EXPECT_EQ(1, power_manager_client->num_request_shutdown_calls());
}
#endif
#if BUILDFLAG(IS_LINUX) && !defined(NDEBUG)
#define MAYBE_InputEvents …
#else
#define MAYBE_InputEvents …
#endif
TEST_F(ShellDesktopControllerAuraTest, MAYBE_InputEvents) { … }
TEST_F(ShellDesktopControllerAuraTest, CloseAppWindows) { … }
TEST_F(ShellDesktopControllerAuraTest, OnAppWindowClose) { … }
TEST_F(ShellDesktopControllerAuraTest, MultipleDisplays) { … }
}