chromium/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc

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

#include "chrome/browser/web_applications/app_service/web_app_publisher_helper.h"

#include <initializer_list>
#include <memory>
#include <sstream>
#include <utility>

#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/traits_bag.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/apps/app_service/app_service_test.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/web_applications/proto/web_app_os_integration_state.pb.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_test_utils.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_constants.h"
#include "chrome/browser/web_applications/web_app_id_constants.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/test/base/testing_profile.h"
#include "components/account_id/account_id.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
#include "components/services/app_service/public/cpp/file_handler.h"
#include "components/services/app_service/public/cpp/intent.h"
#include "components/services/app_service/public/cpp/intent_filter.h"
#include "components/services/app_service/public/cpp/intent_util.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace web_app {

namespace {

class NoOpWebAppPublisherDelegate : public WebAppPublisherHelper::Delegate {};

bool HandlesIntent(const apps::AppPtr& app, const apps::IntentPtr& intent) {}

}  // namespace

class WebAppPublisherHelperTest : public testing::Test {};

TEST_F(WebAppPublisherHelperTest, CreateWebApp_Minimal) {}

TEST_F(WebAppPublisherHelperTest, CreateWebApp_Random) {}

// Verifies that the extended_scope matches the specified domain but not
// unrelated domains.
TEST_F(WebAppPublisherHelperTest, CreateWebApp_ScopeExtension) {}

// Verifies that the extended_scope with a registrable_domain wildcard matches
// the domain and its subdomains but not unrelated domains.
TEST_F(WebAppPublisherHelperTest, CreateWebApp_WildcardScopeExtension) {}

TEST_F(WebAppPublisherHelperTest, CreateWebApp_NoteTaking) {}

TEST_F(WebAppPublisherHelperTest, CreateWebApp_LockScreen_DisabledByFlag) {}

TEST_F(WebAppPublisherHelperTest,
       CreateIntentFiltersForWebApp_WebApp_HasUrlFilter) {}

// TODO(crbug.com/327431493): Use a more holistic approach than adding apps to
// the registry.
TEST_F(WebAppPublisherHelperTest, CreateIntentFiltersForWebApp_FileHandlers) {}

class WebAppPublisherHelperTest_WebLockScreenApi
    : public WebAppPublisherHelperTest {};

TEST_F(WebAppPublisherHelperTest_WebLockScreenApi, CreateWebApp_LockScreen) {}

}  // namespace web_app