chromium/chrome/browser/extensions/permissions/site_access_requests_helper_unittest.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/browser/site_access_requests_helper.h"

#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/permissions/active_tab_permission_granter.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/browser/extensions/permissions/site_permissions_helper.h"
#include "chrome/browser/extensions/tab_helper.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/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/unloaded_extension_reason.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/url_pattern.h"
#include "extensions/test/permissions_manager_waiter.h"

namespace extensions {

class SiteAccessRequestsHelperUnittest : public ExtensionServiceTestBase {};

scoped_refptr<const Extension>
SiteAccessRequestsHelperUnittest::InstallExtensionAndWithholdHostPermissions(
    const std::string& name,
    const std::string& host_permission) {}

scoped_refptr<const Extension>
SiteAccessRequestsHelperUnittest::InstallExtensionWithActiveTab(
    const std::string& name) {}

content::WebContents* SiteAccessRequestsHelperUnittest::AddTab(
    const GURL& url) {}

Browser* SiteAccessRequestsHelperUnittest::browser() {}

void SiteAccessRequestsHelperUnittest::SetUp() {}

void SiteAccessRequestsHelperUnittest::TearDown() {}

// Tests site access requests are properly added and removed.
TEST_F(SiteAccessRequestsHelperUnittest, AddAndRemoveRequests) {}

// Tests that site access requests which include a filter are properly added
// and removed.
TEST_F(SiteAccessRequestsHelperUnittest,
       AddAndRemoveRequestsWithPatternFilter) {}

// Tests that site access requests dismissed by the user are not active
// requests.
TEST_F(SiteAccessRequestsHelperUnittest, UserDismissedRequest) {}

// Tests request is removed on cross-origin navigations.
TEST_F(SiteAccessRequestsHelperUnittest,
       RequestRemovedOnCrossOriginNavigation) {}

// Tests that a request with matching filter pattern are active on same origin
// navigations.
TEST_F(SiteAccessRequestsHelperUnittest, RequestUpdatedOnPageNavigations) {}

// Test request is removed when extension is granted "always on this site" site
// access.
TEST_F(SiteAccessRequestsHelperUnittest,
       RequestRemovedWhenExtensionHasSiteAccess) {}

// Test request is removed when extension is granted one-time site access.
TEST_F(SiteAccessRequestsHelperUnittest,
       RequestRemovedWhenExtensionHasGrantedActiveTab) {}

// Test request is removed when extension is unloaded.
TEST_F(SiteAccessRequestsHelperUnittest,
       RequestRemovedWhenExtensionIsUnloaded) {}

}  // namespace extensions