+TEST_F(SmokeTest, EnablePkg) {
+ bf::path path = kSmokePackagesDirectory / "EnablePkg.wgt";
+ std::string pkgid = "smokeapp22";
+ ASSERT_EQ(Install(path, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+ ASSERT_EQ(DisablePackage(pkgid, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+ ASSERT_EQ(EnablePackage(pkgid, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+
+ ASSERT_TRUE(ci::QueryIsPackageInstalled(pkgid, ci::GetRequestMode()));
+}
+
+TEST_F(SmokeTest, DisablePkg) {
+ bf::path path = kSmokePackagesDirectory / "DisablePkg.wgt";
+ std::string pkgid = "smokeapp21";
+ std::string appid = "smokeapp21.DisablePkg";
+ ASSERT_EQ(Install(path, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+ ASSERT_EQ(DisablePackage(pkgid, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+ ASSERT_FALSE(ci::QueryIsPackageInstalled(pkgid, ci::GetRequestMode()));
+ ValidatePackageFS(pkgid, {appid});
+}
+
+TEST_F(SmokeTest, ClearMode) {
+ bf::path path = kSmokePackagesDirectory / "ClearMode.wgt";
+ std::string pkgid = "smokeapp20";
+ std::string appid = "smokeapp20.ClearMode";
+ ASSERT_EQ(Install(path, PackageType::WGT),
+ ci::AppInstaller::Result::OK);
+ bf::path root_path = ci::GetRootAppPath(false);
+ bs::error_code error;
+ bf::create_directory(root_path / pkgid / "data" / "dir", error);
+ ASSERT_FALSE(error);
+ ASSERT_TRUE(TouchFile(root_path / pkgid / "data" / "dir" / "file"));
+ ASSERT_TRUE(TouchFile(root_path / pkgid / "data" / "file"));
+ ASSERT_EQ(Clear(pkgid, PackageType::WGT), ci::AppInstaller::Result::OK);
+ ValidatePackage(pkgid, {appid});
+ ASSERT_FALSE(bf::exists(root_path / pkgid / "data" / "dir" / "file"));
+ ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "file"));
+}
+