chromium/chrome/browser/ui/views/web_apps/web_app_diy_install_dialog_browsertest.cc

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

#include <memory>

#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/test/metrics/user_action_tester.h"
#include "base/test/test_future.h"
#include "chrome/browser/picture_in_picture/document_picture_in_picture_mixin_test_base.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/test/base/mixin_based_in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/webapps/browser/installable/ml_install_operation_tracker.h"
#include "components/webapps/browser/installable/ml_installability_promoter.h"
#include "content/public/browser/document_picture_in_picture_window_controller.h"
#include "content/public/browser/picture_in_picture_window_controller.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "ui/base/ui_base_types.h"
#include "ui/views/test/dialog_test.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/view_utils.h"
#include "ui/views/widget/any_widget_observer.h"
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
#include "url/url_constants.h"

namespace web_app {

namespace {

class WebAppDiyInstallDialogBrowserTest : public DialogBrowserTest {};

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest, InvokeUiBasic) {}

// Dialog destruction due to navigations or other reasons are measured as
// cancellations from an user action perspective.
IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_widget_destroyed_on_navigation) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_widget_destroyed_on_web_contents_invisible) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_widget_destroyed_on_web_contents_destroyed) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_accept_dialog) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_cancel_dialog) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest, InvokeUi_empty_name) {}

IN_PROC_BROWSER_TEST_F(WebAppDiyInstallDialogBrowserTest,
                       InvokeUi_name_with_spaces) {}

class PictureInPictureDiyDialogOcclusionTest
    : public MixinBasedInProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(PictureInPictureDiyDialogOcclusionTest,
                       PipWindowCloses) {}

}  // namespace

}  // namespace web_app