#include "chrome/browser/extensions/extension_error_controller.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_error_ui.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/test/base/testing_profile.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
namespace extensions {
namespace {
class MockExtensionErrorUI : public ExtensionErrorUI { … };
MockExtensionErrorUI* g_error_ui = …;
MockExtensionErrorUI::MockExtensionErrorUI(ExtensionErrorUI::Delegate* delegate)
: … { … }
MockExtensionErrorUI::~MockExtensionErrorUI() { … }
void MockExtensionErrorUI::CloseUI() { … }
void MockExtensionErrorUI::Accept() { … }
void MockExtensionErrorUI::Details() { … }
bool MockExtensionErrorUI::ShowErrorInBubbleView() { … }
void MockExtensionErrorUI::ShowExtensions() { … }
void MockExtensionErrorUI::Close() { … }
ExtensionErrorUI* CreateMockUI(ExtensionErrorUI::Delegate* delegate) { … }
scoped_refptr<const Extension> BuildExtension() { … }
}
class ExtensionErrorControllerUnitTest : public ExtensionServiceTestBase { … };
void ExtensionErrorControllerUnitTest::SetUp() { … }
testing::AssertionResult
ExtensionErrorControllerUnitTest::AddBlocklistedExtension(
const Extension* extension) { … }
void ExtensionErrorControllerUnitTest::SetBlockExtensionPolicy(
const Extension* extension) { … }
ExtensionPrefs* ExtensionErrorControllerUnitTest::GetPrefs() { … }
TEST_F(ExtensionErrorControllerUnitTest, ClosingAcknowledgesBlocklisted) { … }
TEST_F(ExtensionErrorControllerUnitTest, AcceptingAcknowledgesBlocklisted) { … }
TEST_F(ExtensionErrorControllerUnitTest, DontWarnForAcknowledgedBlocklisted) { … }
TEST_F(ExtensionErrorControllerUnitTest,
ExtensionIsNotBlockedByEnterprisePolicy) { … }
TEST_F(ExtensionErrorControllerUnitTest, ExtensionIsBlockedByEnterprisePolicy) { … }
TEST_F(ExtensionErrorControllerUnitTest, ExtensionIsUnblockedBeforeUIAccepted) { … }
}