chromium/chrome/browser/web_applications/os_integration/protocol_handling_sub_manager_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 <memory>
#include <utility>
#include <vector>

#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/os_integration/web_app_file_handler_manager.h"
#include "chrome/browser/web_applications/os_integration/web_app_protocol_handler_manager.h"
#include "chrome/browser/web_applications/proto/web_app_os_integration_state.pb.h"
#include "chrome/browser/web_applications/test/fake_web_app_provider.h"
#include "chrome/browser/web_applications/test/os_integration_test_override_impl.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/browser/web_applications/test/web_app_test_utils.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_install_params.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/common/chrome_features.h"
#include "components/services/app_service/public/cpp/protocol_handler_info.h"
#include "components/webapps/browser/install_result_code.h"
#include "components/webapps/browser/uninstall_result_code.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

#if BUILDFLAG(IS_MAC)
#include "chrome/browser/web_applications/os_integration/mac/app_shim_registry.h"
#endif

namespace web_app {

ElementsAre;
Eq;
IsEmpty;
enum class ApiApprovalState;

namespace {

class ProtocolHandlingSubManagerTestBase : public WebAppTest {};

ProtocolHandlingConfigureTest;

TEST_F(ProtocolHandlingConfigureTest, ConfigureOnlyProtocolHandler) {}

TEST_F(ProtocolHandlingConfigureTest, UninstalledAppDoesNotConfigure) {}

TEST_F(ProtocolHandlingConfigureTest, ConfigureProtocolHandlerDisallowed) {}

// Synchronize and Execute tests from here onwards. Tests here should
// verify both DB updates as well as OS registrations/unregistrations.
class ProtocolHandlingExecuteTest : public ProtocolHandlingSubManagerTestBase {};

TEST_F(ProtocolHandlingExecuteTest, Register) {}

TEST_F(ProtocolHandlingExecuteTest, Unregister) {}

// This test has extra assertions since Windows registers protocol handlers
// differently than Mac/Linux where protocol handlers are bundled as part
// of the shortcuts OS integration process.
TEST_F(ProtocolHandlingExecuteTest, UpdateHandlers) {}

TEST_F(ProtocolHandlingExecuteTest, DataEqualNoOp) {}

TEST_F(ProtocolHandlingExecuteTest, MultipleSynchronizeEmptyData) {}

TEST_F(ProtocolHandlingExecuteTest, ForceUnregisterAppInRegistry) {}

TEST_F(ProtocolHandlingExecuteTest, ForceUnregisterAppNotInRegistry) {}

}  // namespace

}  // namespace web_app