#include "base/command_line.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/metrics/user_action_tester.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/safe_browsing/tailored_security_desktop_dialog_manager.h"
#include "components/safe_browsing/core/browser/tailored_security_service/tailored_security_outcome.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ui_base_switches.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/point.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/widget/any_widget_observer.h"
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
namespace {
const char kEnhancedProtectionSettingsUrl[] = …;
struct TestParam { … };
std::string ParamToTestSuffix(const ::testing::TestParamInfo<TestParam>& info) { … }
const TestParam kTestParams[] = …;
void ClickButton(views::BubbleDialogDelegate* bubble_delegate,
views::View* button) { … }
}
class TailoredSecurityDesktopDialogManagerTest
: public DialogBrowserTest,
public testing::WithParamInterface<TestParam> { … };
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
InvokeUi_enabledDialog) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
InvokeUi_disabledDialog) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogOkButtonIncrementsAcknowledgedHistogram) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogCancelButtonIncrementsSettingsHistogram) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogCancelButtonNavigatesToSettings) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogRecordsUserActionOnShow) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogOkButtonRecordsUserAction) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
EnabledDialogCancelButtonRecordsUserAction) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogOkButtonIncrementsAcknowledgedHistogram) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogCancelButtonIncrementsSettingsHistogram) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogCancelButtonNavigatesToSettings) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogRecordsUserActionOnShow) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogOkButtonRecordsUserAction) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
DisabledDialogCancelButtonRecordsUserAction) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
OpeningANewEnableDialogWillCloseAnyOpenDisableDialogs) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
ClosingDisabledByOpeningEnabledLogsCloseReason) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
OpeningANewDisableDialogWillCloseAnyOpenEnableDialogs) { … }
IN_PROC_BROWSER_TEST_P(TailoredSecurityDesktopDialogManagerTest,
ClosingEnabledByOpeningDisabledLogsCloseReason) { … }
INSTANTIATE_TEST_SUITE_P(…);