Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: test/unittests/value-serializer-unittest.cc

Issue 2308053002: Handle errors in v8::ValueDeserializer by throwing exceptions. (Closed)
Patch Set: minor cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/value-serializer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/value-serializer-unittest.cc
diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc
index c6dcbd794c47b8504997f78e9ce5c3e81f9a151e..9328b3381800508cbc2460208050dac010525b6b 100644
--- a/test/unittests/value-serializer-unittest.cc
+++ b/test/unittests/value-serializer-unittest.cc
@@ -96,7 +96,7 @@ class ValueSerializerTest : public TestWithIsolate {
static_cast<int>(data.size()));
deserializer.SetSupportsLegacyWireFormat(true);
BeforeDecode(&deserializer);
- ASSERT_TRUE(deserializer.ReadHeader().FromMaybe(false));
+ ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
Local<Value> result;
ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result));
ASSERT_FALSE(result.IsEmpty());
@@ -119,7 +119,7 @@ class ValueSerializerTest : public TestWithIsolate {
static_cast<int>(data.size()));
deserializer.SetSupportsLegacyWireFormat(true);
BeforeDecode(&deserializer);
- ASSERT_TRUE(deserializer.ReadHeader().FromMaybe(false));
+ ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
ASSERT_EQ(0, deserializer.GetWireFormatVersion());
Local<Value> result;
ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result));
@@ -141,10 +141,14 @@ class ValueSerializerTest : public TestWithIsolate {
static_cast<int>(data.size()));
deserializer.SetSupportsLegacyWireFormat(true);
BeforeDecode(&deserializer);
- Maybe<bool> header_result = deserializer.ReadHeader();
- if (header_result.IsNothing()) return;
+ Maybe<bool> header_result = deserializer.ReadHeader(context);
+ if (header_result.IsNothing()) {
+ EXPECT_TRUE(try_catch.HasCaught());
+ return;
+ }
ASSERT_TRUE(header_result.ToChecked());
ASSERT_TRUE(deserializer.ReadValue(context).IsEmpty());
+ EXPECT_TRUE(try_catch.HasCaught());
}
Local<Value> EvaluateScriptForInput(const char* utf8_source) {
« no previous file with comments | « src/value-serializer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698