#include "chrome/browser/ui/views/extensions/extensions_menu_main_page_view.h"
#include "base/feature_list.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/browser/extensions/permissions/site_permissions_helper.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_coordinator.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_view_controller.h"
#include "chrome/browser/ui/views/extensions/extensions_request_access_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_unittest.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension_features.h"
#include "extensions/test/permissions_manager_waiter.h"
#include "extensions/test/test_extension_dir.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/views/controls/button/toggle_button.h"
namespace {
PermissionsManager;
SitePermissionsHelper;
}
class ExtensionsSitePermissionsPageViewUnitTest
: public ExtensionsToolbarUnitTest { … };
ExtensionsSitePermissionsPageViewUnitTest::
ExtensionsSitePermissionsPageViewUnitTest() { … }
void ExtensionsSitePermissionsPageViewUnitTest::ShowSitePermissionsPage(
extensions::ExtensionId extension_id) { … }
bool ExtensionsSitePermissionsPageViewUnitTest::IsMainPageOpened() { … }
bool ExtensionsSitePermissionsPageViewUnitTest::IsSitePermissionsPageOpened(
extensions::ExtensionId extension_id) { … }
std::vector<extensions::ExtensionId>
ExtensionsSitePermissionsPageViewUnitTest::GetExtensionsShowingRequests() { … }
void ExtensionsSitePermissionsPageViewUnitTest::NavigateAndCommit(
const std::string& string_url) { … }
void ExtensionsSitePermissionsPageViewUnitTest::LayoutMenuIfNecessary() { … }
ExtensionsMenuMainPageView*
ExtensionsSitePermissionsPageViewUnitTest::main_page() { … }
ExtensionsMenuSitePermissionsPageView*
ExtensionsSitePermissionsPageViewUnitTest::site_permissions_page() { … }
void ExtensionsSitePermissionsPageViewUnitTest::SetUp() { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
AddAndRemoveExtensionWhenSitePermissionsPageIsOpen) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest, DisableAndEnableExtension) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest, ReloadExtension) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest, ShowRequestsTogglePressed) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
ShowRequestsPrefChangedWithMenuOpen) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest, SiteAccessUpdated) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
SiteAccessUpdatedWithMenuOpen_OnClick) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
SiteAccessUpdatedWithMenuOpen_OnSite) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
SiteAccessUpdatedWithMenuOpen_OnAllSites) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
PageNavigationWithMenuOpen_UserLosesRuntimeHostPermissionsControls) { … }
TEST_F(ExtensionsSitePermissionsPageViewUnitTest,
PageNavigationWithMenuOpen_UserMaintainsRuntimeHostPermissionsControls) { … }