#include "extensions/renderer/api/runtime_hooks_delegate.h"
#include <memory>
#include <string_view>
#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/crx_file/id_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/mojom/context_type.mojom.h"
#include "extensions/common/mojom/frame.mojom.h"
#include "extensions/common/mojom/message_port.mojom-shared.h"
#include "extensions/renderer/api/messaging/message_target.h"
#include "extensions/renderer/api/messaging/native_renderer_messaging_service.h"
#include "extensions/renderer/api/messaging/send_message_tester.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "extensions/renderer/native_extension_bindings_system.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 {
void CallAPIAndExpectError(v8::Local<v8::Context> context,
std::string_view method_name,
std::string_view args) { … }
}
class RuntimeHooksDelegateTest : public NativeExtensionBindingsSystemUnittest { … };
TEST_F(RuntimeHooksDelegateTest, RuntimeId) { … }
TEST_F(RuntimeHooksDelegateTest, GetManifest) { … }
TEST_F(RuntimeHooksDelegateTest, GetURL) { … }
TEST_F(RuntimeHooksDelegateTest, Connect) { … }
TEST_F(RuntimeHooksDelegateTest, SendMessage) { … }
TEST_F(RuntimeHooksDelegateTest, SendMessageErrors) { … }
TEST_F(RuntimeHooksDelegateTest, ConnectWithTrickyOptions) { … }
class RuntimeHooksDelegateNativeMessagingTest
: public RuntimeHooksDelegateTest { … };
TEST_F(RuntimeHooksDelegateNativeMessagingTest, ConnectNative) { … }
TEST_F(RuntimeHooksDelegateNativeMessagingTest, SendNativeMessage) { … }
class RuntimeHooksDelegateMV3Test : public RuntimeHooksDelegateTest { … };
TEST_F(RuntimeHooksDelegateMV3Test, SendMessageUsingPromise) { … }
TEST_F(RuntimeHooksDelegateMV3Test, RequestUpdateCheck) { … }
class RuntimeHooksDelegateNativeMessagingMV3Test
: public RuntimeHooksDelegateTest { … };
TEST_F(RuntimeHooksDelegateNativeMessagingMV3Test, SendNativeMessage) { … }
}