#include "extensions/renderer/api/messaging/send_message_tester.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/gmock_callback_support.h"
#include "extensions/common/mojom/message_port.mojom-shared.h"
#include "extensions/renderer/api/messaging/messaging_util.h"
#include "extensions/renderer/api/messaging/mock_message_port_host.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "extensions/renderer/native_extension_bindings_system_test_base.h"
#include "extensions/renderer/script_context.h"
#include "ipc/ipc_message.h"
#include "v8/include/v8.h"
namespace extensions {
SendMessageTester::SendMessageTester(TestIPCMessageSender* ipc_sender,
ScriptContext* script_context,
int next_port_id,
const std::string& api_namespace)
: … { … }
SendMessageTester::~SendMessageTester() = default;
v8::Local<v8::Value> SendMessageTester::TestSendMessage(
const std::string& args,
const std::string& expected_message,
const MessageTarget& expected_target,
PortStatus expected_port_status) { … }
v8::Local<v8::Value> SendMessageTester::TestSendRequest(
const std::string& args,
const std::string& expected_message,
const MessageTarget& expected_target,
PortStatus expected_port_status) { … }
v8::Local<v8::Value> SendMessageTester::TestSendNativeMessage(
const std::string& args,
const std::string& expected_message,
const std::string& expected_application_name) { … }
void SendMessageTester::TestConnect(const std::string& args,
const std::string& expected_channel,
const MessageTarget& expected_target) { … }
void SendMessageTester::TestSendMessageOrRequest(
const std::string& args,
const std::string& expected_message,
const MessageTarget& expected_target,
PortStatus expected_port_status,
Method method,
v8::Local<v8::Value>& out_value) { … }
}