chromium/extensions/renderer/bindings/test_js_runner.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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 {

// NOTE(devlin): These aren't thread-safe. If we have multi-threaded unittests,
// we'll need to expand these.
bool g_allow_errors =;
bool g_suspended =;

std::optional<base::Value> Convert(v8::MaybeLocal<v8::Value> maybe_value,
                                   v8::Local<v8::Context> context) {}

}  // namespace

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() {}

}  // namespace extensions