#include "extensions/renderer/native_extension_bindings_system.h"
#include <string_view>
#include "base/command_line.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/crx_file/id_util.h"
#include "extensions/common/extension_api.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/manifest.h"
#include "extensions/common/mojom/context_type.mojom.h"
#include "extensions/common/mojom/event_dispatcher.mojom.h"
#include "extensions/common/mojom/frame.mojom.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/api/messaging/message_target.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "extensions/renderer/bindings/api_invocation_errors.h"
#include "extensions/renderer/bindings/api_response_validator.h"
#include "extensions/renderer/bindings/test_js_runner.h"
#include "extensions/renderer/native_extension_bindings_system_test_base.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_context_set.h"
namespace extensions {
namespace {
bool PropertyExists(v8::Local<v8::Context> context, std::string_view property) { … }
}
TEST_F(NativeExtensionBindingsSystemUnittest, Basic) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, Events) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, APIObjectsAreEqual) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
ReferencingAPIAfterDisposingContext) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestBridgingToJSCustomBindings) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestSendRequestHook) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestEventRegistration) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
TestPrefixedApiEventsAndAppBinding) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
TestPrefixedApiMethodsAndSystemBinding) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestLastError) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestCustomProperties) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
CheckDifferentContextsHaveDifferentAPIObjects) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestUsingOtherChromeObjects) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, TestUpdatingPermissions) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, UnmanagedEvents) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
AccessToAliasSourceDoesntGiveAliasAccess) { … }
TEST_F(NativeExtensionBindingsSystemUnittest,
AccessToAliasDoesntGiveAliasSourceAccess) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, AliasedAPIsAreDifferentObjects) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, CanOverwriteAPIs) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, CanDeleteAPIs) { … }
TEST_F(NativeExtensionBindingsSystemUnittest, APIIsInitializedByOwningContext) { … }
class SignatureValidationNativeExtensionBindingsSystemUnittest
: public NativeExtensionBindingsSystemUnittest,
public testing::WithParamInterface<bool> { … };
TEST_P(SignatureValidationNativeExtensionBindingsSystemUnittest,
ResponseValidation) { … }
TEST_P(SignatureValidationNativeExtensionBindingsSystemUnittest,
EventArgumentValidation) { … }
INSTANTIATE_TEST_SUITE_P(…);
class FeatureAvailabilityNativeExtensionBindingsSystemUnittest
: public NativeExtensionBindingsSystemUnittest,
public testing::WithParamInterface<bool> { … };
TEST_P(FeatureAvailabilityNativeExtensionBindingsSystemUnittest,
CheckRestrictedFeaturesBasedOnContext) { … }
INSTANTIATE_TEST_SUITE_P(…);
}