#include "chrome/browser/extensions/permissions/site_permissions_helper.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_with_install.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/permissions/permissions_updater.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/test_browser_window.h"
#include "components/crx_file/id_util.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.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/permissions_data.h"
#include "extensions/test/permissions_manager_waiter.h"
namespace extensions {
UserSiteAccess;
SiteInteraction;
class SitePermissionsHelperUnitTest : public ExtensionServiceTestWithInstall { … };
scoped_refptr<const Extension> SitePermissionsHelperUnitTest::InstallExtension(
const std::string& name) { … }
scoped_refptr<const Extension>
SitePermissionsHelperUnitTest::InstallExtensionWithPermissions(
const std::string& name,
const std::vector<std::string>& host_permissions,
const std::vector<std::string>& permissions) { … }
content::WebContents* SitePermissionsHelperUnitTest::AddTab(const GURL& url) { … }
Browser* SitePermissionsHelperUnitTest::browser() { … }
void SitePermissionsHelperUnitTest::SetUp() { … }
void SitePermissionsHelperUnitTest::TearDown() { … }
TEST_F(SitePermissionsHelperUnitTest, SiteAccessAndInteraction_AllUrls) { … }
TEST_F(SitePermissionsHelperUnitTest, SiteAccessAndInteraction_RequestedUrl) { … }
TEST_F(SitePermissionsHelperUnitTest, SiteAccessAndInteraction_ActiveTab) { … }
TEST_F(SitePermissionsHelperUnitTest,
SiteAccessAndInteraction_ActiveTabAndRequestedUrl) { … }
TEST_F(SitePermissionsHelperUnitTest,
SiteAccessAndInteraction_NoHostPermissions) { … }
TEST_F(SitePermissionsHelperUnitTest, UpdateSiteAccess_OnlySiteSelected) { … }
class SitePermissionsHelperWithUserHostControlsUnitTest
: public SitePermissionsHelperUnitTest { … };
TEST_F(SitePermissionsHelperWithUserHostControlsUnitTest,
DowngradingFromAllSitesToOnClickAppliesUserPermittedSites) { … }
}