#include "extensions/renderer/bindings/api_request_handler.h"
#include <optional>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/strcat.h"
#include "base/test/bind.h"
#include "base/values.h"
#include "extensions/renderer/bindings/api_binding_test.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "extensions/renderer/bindings/exception_handler.h"
#include "extensions/renderer/bindings/test_interaction_provider.h"
#include "extensions/renderer/bindings/test_js_runner.h"
#include "extensions/renderer/v8_helpers.h"
#include "gin/converter.h"
#include "gin/function_template.h"
#include "gin/public/context_holder.h"
#include "gin/public/isolate_holder.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace extensions {
namespace {
const char kEchoArgs[] = …;
const char kMethod[] = …;
ArgumentList;
}
class APIRequestHandlerTest : public APIBindingTest { … };
TEST_F(APIRequestHandlerTest, AddRequestAndCompleteRequestTest) { … }
TEST_F(APIRequestHandlerTest, InvalidRequestsTest) { … }
TEST_F(APIRequestHandlerTest, MultipleRequestsAndContexts) { … }
TEST_F(APIRequestHandlerTest, CustomCallbackArguments) { … }
TEST_F(APIRequestHandlerTest, CustomCallbackWithErrorInExtensionCallback) { … }
TEST_F(APIRequestHandlerTest, CustomCallbackPromiseBased) { … }
TEST_F(APIRequestHandlerTest, CustomCallbackArgumentsWithEmptyCallback) { … }
TEST_F(APIRequestHandlerTest, ResultModifier) { … }
TEST_F(APIRequestHandlerTest, UserGestureTest) { … }
TEST_F(APIRequestHandlerTest, SettingLastError) { … }
TEST_F(APIRequestHandlerTest, AddPendingRequestCallback) { … }
TEST_F(APIRequestHandlerTest, AddPendingRequestPromise) { … }
TEST_F(APIRequestHandlerTest, AddPendingRequestWithResultModifier) { … }
TEST_F(APIRequestHandlerTest, ThrowExceptionInCallback) { … }
TEST_F(APIRequestHandlerTest, PromiseBasedRequests_Fulfilled) { … }
TEST_F(APIRequestHandlerTest, PromiseBasedRequests_Rejected) { … }
}