chromium/chrome/browser/ui/views/autofill/payments/webauthn_dialog_browsertest.cc

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

#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "chrome/browser/ui/autofill/payments/webauthn_dialog.h"
#include "chrome/browser/ui/autofill/payments/webauthn_dialog_controller_impl.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/autofill/payments/webauthn_dialog_view.h"
#include "content/public/test/browser_test.h"

namespace autofill {

namespace {
// If ShowAndVerifyUi() is used, the tests must be named as "InvokeUi_"
// appending these names.
constexpr char kOfferDialogName[] =;
constexpr char kVerifyDialogName[] =;
}  // namespace

class WebauthnDialogBrowserTest : public DialogBrowserTest {};

IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest, InvokeUi_Offer) {}

// Ensures closing tab while dialog being visible is correctly handled.
// RunUntilIdle() makes sure that nothing crashes after browser tab is closed.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       OfferDialog_CanCloseTabWhileDialogShowing) {}

// Ensures closing browser while dialog being visible is correctly handled.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       OfferDialog_CanCloseBrowserWhileDialogShowing) {}

// Ensures dialog is closed when cancel button is clicked.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       OfferDialog_ClickCancelButton) {}

IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest, InvokeUi_Verify) {}

IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       VerifyPendingDialog_CanCloseTabWhileDialogShowing) {}

// Ensures closing browser while dialog being visible is correctly handled.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       VerifyPendingDialog_CanCloseBrowserWhileDialogShowing) {}

// Ensures dialog can be closed when verification finishes.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       VerifyPendingDialog_VerificationFinishes) {}

// Ensures dialog is closed when cancel button is clicked.
IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest,
                       VerifyPendingDialog_ClickCancelButton) {}

}  // namespace autofill