#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
ExtensionManifestKioskModeTest;
TEST_F(ExtensionManifestKioskModeTest, InvalidKioskEnabled) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskEnabledHostedApp) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskEnabledPackagedApp) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskEnabledExtension) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskEnabledPlatformApp) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskDisabledPlatformApp) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskDefaultPlatformApp) { … }
TEST_F(ExtensionManifestKioskModeTest, KioskEnabledDefaultRequired) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyPlatformApp) {
scoped_refptr<Extension> extension(
LoadAndExpectSuccess("kiosk_only_platform_app.json"));
EXPECT_TRUE(KioskModeInfo::IsKioskOnly(extension.get()));
}
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyInvalid) {
LoadAndExpectError("kiosk_only_invalid.json",
manifest_errors::kInvalidKioskOnly);
}
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyButNotEnabled) {
LoadAndExpectError("kiosk_only_not_enabled.json",
manifest_errors::kInvalidKioskOnlyButNotEnabled);
}
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyHostedApp) {
scoped_refptr<Extension> extension(
LoadAndExpectSuccess("kiosk_only_hosted_app.json"));
EXPECT_FALSE(KioskModeInfo::IsKioskOnly(extension.get()));
}
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyPackagedApp) {
scoped_refptr<Extension> extension(
LoadAndExpectSuccess("kiosk_only_packaged_app.json"));
EXPECT_FALSE(KioskModeInfo::IsKioskOnly(extension.get()));
}
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyExtension) {
scoped_refptr<Extension> extension(
LoadAndExpectSuccess("kiosk_only_extension.json"));
EXPECT_FALSE(KioskModeInfo::IsKioskOnly(extension.get()));
}
#else
TEST_F(ExtensionManifestKioskModeTest, KioskOnlyFromNonChromeos) { … }
#endif
}