chromium/chrome/browser/ui/views/web_apps/simple_install_dialog_bubble_view_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/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.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/web_applications/test/web_app_browsertest_util.h"
#include "chrome/browser/ui/web_applications/web_app_browsertest_base.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/web_app_constants.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_pref_guardrails.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/webapps/browser/installable/ml_install_operation_tracker.h"
#include "components/webapps/browser/installable/ml_installability_promoter.h"
#include "components/webapps/common/web_app_id.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/test/browser_test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/test/dialog_test.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/any_widget_observer.h"
#include "ui/views/widget/widget.h"

namespace web_app {
namespace {

// Creates a dummy WebAppInstallInfo instance used to populate details on the
// install dialog.
std::unique_ptr<WebAppInstallInfo> GetAppInfo() {}

// Creates an installation tracker for ML installability promoter required by
// the install dialog.
std::unique_ptr<webapps::MlInstallOperationTracker> GetInstallTracker(
    Browser* browser) {}

class SimpleInstallDialogBubbleViewBrowserTest
    : public WebAppBrowserTestBase,
      public testing::WithParamInterface<bool> {};

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       ShowBubbleInPWAWindow) {}

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       CancelledDialogReportsMetrics) {}

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       AcceptDialogReportsMetrics) {}

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       CancelledDialogReportsIphIgnored) {}

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       AcceptDialogResetIphCounters) {}

IN_PROC_BROWSER_TEST_P(SimpleInstallDialogBubbleViewBrowserTest,
                       CancelFromNavigation) {}

INSTANTIATE_TEST_SUITE_P();

class PictureInPictureSimpleInstallDialogOcclusionTest
    : public MixinBasedInProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(PictureInPictureSimpleInstallDialogOcclusionTest,
                       PipWindowCloses) {}

}  // namespace
}  // namespace web_app