chromium/chrome/browser/web_applications/os_integration/shortcut_menu_handling_sub_manager_unittest.cc

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

#include <cstddef>
#include <memory>
#include <utility>
#include <vector>

#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_future.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/os_integration/os_integration_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_icon_test_utils.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_icon_generator.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_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/common/chrome_features.h"
#include "components/webapps/browser/install_result_code.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

#if BUILDFLAG(IS_WIN)
#include "chrome/browser/web_applications/os_integration/web_app_shortcuts_menu_win.h"
#endif

ElementsAreArray;
Eq;

namespace web_app {

namespace {

class ShortcutMenuHandlingSubManagerTestBase : public WebAppTest {};

// Synchronize tests only. Tests here should only verify DB updates.
ShortcutMenuHandlingSubManagerConfigureTest;

TEST_F(ShortcutMenuHandlingSubManagerConfigureTest, TestConfigure) {}

// Tests handling crashes fixed in crbug.com/1417955.
TEST_F(ShortcutMenuHandlingSubManagerConfigureTest, IconsButNoShortcutInfo) {}

// Tests handling crashes fixed in crbug.com/1417955.
TEST_F(ShortcutMenuHandlingSubManagerConfigureTest,
       LessShortcutMenuItemsThanIconInfos) {}

// This tests our handling of https://crbug.com/1427444.
TEST_F(ShortcutMenuHandlingSubManagerConfigureTest, NoDownloadedIcons_1427444) {}

// Synchronize and Execute tests from here onwards. Tests here should
// verify both DB updates as well as OS registrations/unregistrations.
ShortcutMenuHandlingSubManagerExecuteTest;

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest, InstallWritesCorrectData) {}

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest,
       EmptyDataDoesNotRegisterShortcutsMenu) {}

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest,
       UninstallRemovesShortcutMenuItems) {}

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest, UpdateShortcutMenuItems) {}

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest,
       ForceUnregisterAppInRegistry) {}

TEST_F(ShortcutMenuHandlingSubManagerExecuteTest,
       ForceUnregisterAppNotInRegistry) {}

}  // namespace

}  // namespace web_app