Free Isolate in ValueSerializerUnittest

BUG=v8:6316
R=jbroman@chromium.org,yangguo@chromium.org

Change-Id: Icfc33e3e51cdbfad246a971a5a2737a8fdfba058
Reviewed-on: https://chromium-review.googlesource.com/488941
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44963}
This commit is contained in:
Jochen Eisinger 2017-04-27 17:55:19 +02:00 committed by Commit Bot
parent e3d93222d6
commit 32124f3b13
2 changed files with 17 additions and 17 deletions

View File

@ -1866,21 +1866,24 @@ TEST_F(ValueSerializerTest, DecodeArrayBufferOOM) {
Isolate::CreateParams params;
params.array_buffer_allocator = &allocator;
Isolate* isolate = Isolate::New(params);
Isolate::Scope isolate_scope(isolate);
HandleScope handle_scope(isolate);
Local<Context> context = Context::New(isolate);
Context::Scope context_scope(context);
TryCatch try_catch(isolate);
{
Isolate::Scope isolate_scope(isolate);
HandleScope handle_scope(isolate);
Local<Context> context = Context::New(isolate);
Context::Scope context_scope(context);
TryCatch try_catch(isolate);
const std::vector<uint8_t> data = {0xff, 0x09, 0x3f, 0x00, 0x42,
0x03, 0x00, 0x80, 0xff, 0x00};
ValueDeserializer deserializer(isolate, &data[0],
static_cast<int>(data.size()), nullptr);
deserializer.SetSupportsLegacyWireFormat(true);
ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
ASSERT_FALSE(try_catch.HasCaught());
EXPECT_TRUE(deserializer.ReadValue(context).IsEmpty());
EXPECT_TRUE(try_catch.HasCaught());
const std::vector<uint8_t> data = {0xff, 0x09, 0x3f, 0x00, 0x42,
0x03, 0x00, 0x80, 0xff, 0x00};
ValueDeserializer deserializer(isolate, &data[0],
static_cast<int>(data.size()), nullptr);
deserializer.SetSupportsLegacyWireFormat(true);
ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
ASSERT_FALSE(try_catch.HasCaught());
EXPECT_TRUE(deserializer.ReadValue(context).IsEmpty());
EXPECT_TRUE(try_catch.HasCaught());
}
isolate->Dispose();
}
// Includes an ArrayBuffer wrapper marked for transfer from the serialization

View File

@ -14,6 +14,3 @@ leak:v8::internal::compiler::JumpThreading::ApplyForwarding
# mjsunit
leak:v8::internal::FuncNameInferrer::FuncNameInferrer
leak:v8::internal::JSArrayBuffer::SetupAllocatingData
# unittests
leak:v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread