Index: test/unittests/value-serializer-unittest.cc |
diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc |
index 1a5fbe3e3c39f6c4184e915fd58b7a2cbb9024d4..cd2afa09f12559fb24e77bcfde59785089ed1a50 100644 |
--- a/test/unittests/value-serializer-unittest.cc |
+++ b/test/unittests/value-serializer-unittest.cc |
@@ -2370,8 +2370,9 @@ class ValueSerializerTestWithHostObject : public ValueSerializerTest { |
friend class DeserializerDelegate; |
}; |
-// This is a tag that's not used in V8. |
-const uint8_t ValueSerializerTestWithHostObject::kExampleHostObjectTag = '+'; |
+// This is a tag that is used in V8. Using this ensures that we have separate |
+// tag namespaces. |
+const uint8_t ValueSerializerTestWithHostObject::kExampleHostObjectTag = 'T'; |
TEST_F(ValueSerializerTestWithHostObject, RoundTripUint32) { |
// The host can serialize data as uint32_t. |
@@ -2544,6 +2545,19 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripSameObject) { |
}); |
} |
+TEST_F(ValueSerializerTestWithHostObject, DecodeSimpleHostObject) { |
+ EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate())) |
+ .WillRepeatedly(Invoke([this](Isolate*) { |
+ EXPECT_TRUE(ReadExampleHostObjectTag()); |
+ return NewHostObject(deserialization_context(), 0, nullptr); |
+ })); |
+ DecodeTest( |
+ {0xff, 0x0d, 0x5c, kExampleHostObjectTag}, [this](Local<Value> value) { |
+ EXPECT_TRUE(EvaluateScriptForResultBool( |
+ "Object.getPrototypeOf(result) === ExampleHostObject.prototype")); |
+ }); |
+} |
+ |
class ValueSerializerTestWithHostArrayBufferView |
: public ValueSerializerTestWithHostObject { |
protected: |