diff options
Diffstat (limited to 'deps/v8/test/cctest/wasm/test-wasm-serialization.cc')
-rw-r--r-- | deps/v8/test/cctest/wasm/test-wasm-serialization.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/deps/v8/test/cctest/wasm/test-wasm-serialization.cc b/deps/v8/test/cctest/wasm/test-wasm-serialization.cc index 2a486303e89..75bdff0571b 100644 --- a/deps/v8/test/cctest/wasm/test-wasm-serialization.cc +++ b/deps/v8/test/cctest/wasm/test-wasm-serialization.cc @@ -69,10 +69,11 @@ class WasmSerializationTest { base::WriteUnalignedValue<uint32_t>(num_functions_slot, 0); } - MaybeHandle<WasmModuleObject> Deserialize() { + MaybeHandle<WasmModuleObject> Deserialize( + Vector<const char> source_url = {}) { return DeserializeNativeModule(CcTest::i_isolate(), VectorOf(serialized_bytes_), - VectorOf(wire_bytes_), {}); + VectorOf(wire_bytes_), source_url); } void DeserializeAndRun() { @@ -200,6 +201,19 @@ TEST(DeserializeValidModule) { test.CollectGarbage(); } +TEST(DeserializeWithSourceUrl) { + WasmSerializationTest test; + { + HandleScope scope(CcTest::i_isolate()); + const std::string url = "http://example.com/example.wasm"; + Handle<WasmModuleObject> module_object; + CHECK(test.Deserialize(VectorOf(url)).ToHandle(&module_object)); + String source_url = String::cast(module_object->script().source_url()); + CHECK_EQ(url, source_url.ToCString().get()); + } + test.CollectGarbage(); +} + TEST(DeserializeMismatchingVersion) { WasmSerializationTest test; { |