#include "chrome/browser/web_applications/web_app_utils.h"
#include <memory>
#include "base/containers/adapters.h"
#include "base/files/file_path.h"
#include "base/test/scoped_feature_list.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom.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_id_constants.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#include "components/user_manager/scoped_user_manager.h"
#endif
namespace web_app {
WebAppUtilsTest;
ElementsAre;
TEST(WebAppTest, SortedSizesPxIsAscending) { … }
TEST(WebAppTest, ResolveEffectiveDisplayMode) { … }
TEST(WebAppTest,
ResolveEffectiveDisplayModeWithDisplayOverridesPreferUserMode) { … }
TEST(WebAppTest,
ResolveEffectiveDisplayModeWithDisplayOverridesFallbackToDisplayMode) { … }
TEST(WebAppTest, ResolveEffectiveDisplayModeWithDisplayOverrides) { … }
TEST(WebAppTest, ResolveEffectiveDisplayModeWithIsolatedWebApp) { … }
TEST_F(WebAppUtilsTest, AreWebAppsEnabled) { … }
TEST_F(WebAppUtilsTest, AreWebAppsUserInstallable) { … }
TEST_F(WebAppUtilsTest, GetBrowserContextForWebApps) { … }
TEST_F(WebAppUtilsTest, GetBrowserContextForWebAppMetrics) { … }
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS)
TEST_F(WebAppUtilsTest, CanUserUninstallContainerApp) {
EXPECT_FALSE(CanUserUninstallWebApp(
kContainerAppId, WebAppManagementTypes({WebAppManagement::kDefault})));
EXPECT_TRUE(CanUserUninstallWebApp(
kContainerAppId, WebAppManagementTypes({WebAppManagement::kSync})));
}
TEST_F(WebAppUtilsTest, ContainerAppWillBeSystemWebApp) {
for (auto src : WebAppManagementTypes::All()) {
EXPECT_THAT(
WillBeSystemWebApp(kContainerAppId, WebAppManagementTypes({src})),
src == WebAppManagement::kDefault);
}
}
#endif
}