#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
#include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
#include "chrome/browser/ui/views/page_info/permission_toggle_row_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/interaction/interactive_browser_test.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "ui/events/test/test_event.h"
#include "ui/views/controls/button/toggle_button.h"
#include "ui/views/interaction/interaction_test_util_views.h"
namespace {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(…);
const char kFirstPermissionRow[] = …;
void OpenPageInfoBubble(Browser* browser) { … }
class FocusTracker { … };
class WebContentsFocusTracker : public FocusTracker,
public content::WebContentsObserver { … };
class ViewFocusTracker : public FocusTracker, public views::ViewObserver { … };
}
class PageInfoBubbleViewFocusInteractiveUiTest : public InProcessBrowserTest { … };
#if BUILDFLAG(IS_MAC)
#define MAYBE_FocusReturnsToContentOnClose …
#else
#define MAYBE_FocusReturnsToContentOnClose …
#endif
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewFocusInteractiveUiTest,
MAYBE_FocusReturnsToContentOnClose) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_FocusDoesNotReturnToContentsOnReloadPrompt …
#else
#define MAYBE_FocusDoesNotReturnToContentsOnReloadPrompt …
#endif
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewFocusInteractiveUiTest,
MAYBE_FocusDoesNotReturnToContentsOnReloadPrompt) { … }
class PageInfoBubbleViewInteractiveUiTest : public InteractiveBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewInteractiveUiTest,
ToggleTest_DefaultAsk) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewInteractiveUiTest,
ToggleTest_DefaultBlock) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewInteractiveUiTest,
BroadExceptionToggleTest_DefaultAllow) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewInteractiveUiTest,
BroadExceptionToggleTest_DefaultBlock) { … }