#include "chrome/browser/extensions/permissions/permissions_updater.h"
#include <memory>
#include <utility>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_file_value_serializer.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/permissions/permissions_test_util.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_test_util.h"
#include "chrome/test/base/testing_profile.h"
#include "components/crx_file/id_util.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/test/permissions_manager_waiter.h"
#include "extensions/test/test_extension_dir.h"
#include "testing/gtest/include/gtest/gtest.h"
LoadManifest;
APIPermissionID;
namespace extensions {
namespace {
scoped_refptr<const Extension> CreateExtensionWithOptionalPermissions(
base::Value::List optional_permissions,
base::Value::List permissions,
const std::string& name) { … }
class PermissionsUpdaterTest : public ExtensionServiceTestBase { … };
void AddPattern(URLPatternSet* extent, const std::string& pattern) { … }
}
TEST_F(PermissionsUpdaterTest, GrantAndRevokeOptionalPermissions) { … }
TEST_F(PermissionsUpdaterTest, RevokingPermissions) { … }
TEST_F(PermissionsUpdaterTest,
UpdatingRuntimeGrantedPermissionsWithOptionalPermissions) { … }
TEST_F(PermissionsUpdaterTest,
UpdatingRuntimeGrantedPermissionsWithRuntimePermissions) { … }
TEST_F(PermissionsUpdaterTest, RevokingPermissionsWithRuntimeHostPermissions) { … }
TEST_F(PermissionsUpdaterTest, ChromeFaviconIsNotARevokableHost) { … }
TEST_F(PermissionsUpdaterTest, GrantingBroadRuntimePermissions) { … }
TEST_F(PermissionsUpdaterTest,
DontOverwriteDesiredActivePermissionsOnOptionalPermissionsGrant) { … }
TEST_F(PermissionsUpdaterTest,
DontOverwriteDesiredActivePermissionsOnExtensionLoad) { … }
TEST_F(PermissionsUpdaterTest, DesiredActivePermissionsAreFixedOnLoad) { … }
class PermissionsUpdaterTestWithEnhancedHostControls
: public PermissionsUpdaterTest { … };
TEST_F(PermissionsUpdaterTestWithEnhancedHostControls,
RevokingPermissionsWithUserPermittedSites) { … }
}