chromium/chrome/browser/ui/views/session_crashed_bubble_view_browsertest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/session_crashed_bubble_view.h"

#include <string>

#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/browser_test.h"
#include "ui/base/buildflags.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/test/ax_event_counter.h"
#include "ui/views/view.h"

class SessionCrashedBubbleViewTest : public DialogBrowserTest {};

IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest,
                       InvokeUi_SessionCrashedBubble) {}

IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest,
                       InvokeUi_SessionCrashedBubbleOfferUma) {}

// Regression test for https://crbug.com/1042010, it should be possible to focus
// the bubble with the "focus dialog" hotkey combination (Alt+Shift+A).
// TODO(crbug.com/40856612): Flaky on mac-12-arm64-rel.
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64) && defined(NDEBUG)
#define MAYBE_CanFocusBubbleWithFocusDialogHotkey
#else
#define MAYBE_CanFocusBubbleWithFocusDialogHotkey
#endif
IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest,
                       MAYBE_CanFocusBubbleWithFocusDialogHotkey) {}

// Regression test for https://crbug.com/1042010, it should be possible to focus
// the bubble with the "rotate pane focus" (F6) hotkey.
// TODO(crbug.com/40852599): Flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_CanFocusBubbleWithRotatePaneFocusHotkey
#else
#define MAYBE_CanFocusBubbleWithRotatePaneFocusHotkey
#endif
IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest,
                       MAYBE_CanFocusBubbleWithRotatePaneFocusHotkey) {}

IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest, AlertAccessibleEvent) {}

// Regression test for https://crbug.com/1081393.
IN_PROC_BROWSER_TEST_F(SessionCrashedBubbleViewTest, HasCloseButton) {}