chromium/v8/test/cctest/wasm/test-wasm-codegen.cc

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Tests effects of (CSP) "unsafe-eval" and "wasm-eval" callback functions.
//
// Note: These tests are in a separate test file because the tests dynamically
// change the isolate in terms of callbacks allow_code_gen_callback and
// allow_wasm_code_gen_callback.

#include "src/api/api-inl.h"
#include "src/wasm/wasm-module-builder.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-objects.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"
#include "test/common/wasm/wasm-module-runner.h"

namespace v8 {
namespace internal {
namespace wasm {

namespace {

// Possible values for callback pointers.
enum TestValue {};

constexpr int kNumTestValues =;

const char* TestValueName[kNumTestValues] =;

// Defined to simplify iterating over TestValues;
const TestValue AllTestValues[kNumTestValues] =;

// This matrix holds the results of setting allow_code_gen_callback
// (first index) and allow_wasm_code_gen_callback (second index) using
// TestValue's. The value in the matrix is true if compilation is
// allowed, and false otherwise.
const bool ExpectedResults[kNumTestValues][kNumTestValues] =;

bool TrueCallback(Local<v8::Context>, Local<v8::String>) {}

bool FalseCallback(Local<v8::Context>, Local<v8::String>) {}

CallbackFn;

// Defines the Callback to use for the corresponding TestValue.
CallbackFn Callback[kNumTestValues] =;

void BuildTrivialModule(Zone* zone, ZoneBuffer* buffer) {}

bool TestModule(Isolate* isolate, v8::MemorySpan<const uint8_t> wire_bytes) {}

}  // namespace

TEST(PropertiesOfCodegenCallbacks) {}

TEST(WasmModuleObjectCompileFailure) {}

}  // namespace wasm
}  // namespace internal
}  // namespace v8