#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/renderer/bindings/test_js_runner.h"
#include <ostream>
#include "base/functional/bind.h"
#include "content/public/renderer/v8_value_converter.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
namespace extensions {
namespace {
bool g_allow_errors = …;
bool g_suspended = …;
std::optional<base::Value> Convert(v8::MaybeLocal<v8::Value> maybe_value,
v8::Local<v8::Context> context) { … }
}
TestJSRunner::Scope::Scope(std::unique_ptr<JSRunner> runner)
: … { … }
TestJSRunner::Scope::~Scope() { … }
TestJSRunner::AllowErrors::AllowErrors() { … }
TestJSRunner::AllowErrors::~AllowErrors() { … }
TestJSRunner::Suspension::Suspension() { … }
TestJSRunner::Suspension::~Suspension() { … }
TestJSRunner::PendingCall::PendingCall() = default;
TestJSRunner::PendingCall::~PendingCall() = default;
TestJSRunner::PendingCall::PendingCall(PendingCall&& other) = default;
TestJSRunner::TestJSRunner() = default;
TestJSRunner::TestJSRunner(const base::RepeatingClosure& will_call_js)
: … { … }
TestJSRunner::~TestJSRunner() = default;
void TestJSRunner::RunJSFunction(v8::Local<v8::Function> function,
v8::Local<v8::Context> context,
int argc,
v8::Local<v8::Value> argv[],
ResultCallback callback) { … }
v8::MaybeLocal<v8::Value> TestJSRunner::RunJSFunctionSync(
v8::Local<v8::Function> function,
v8::Local<v8::Context> context,
int argc,
v8::Local<v8::Value> argv[]) { … }
void TestJSRunner::Flush() { … }
}