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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp

Issue 2731533002: Move the full Blink version envelope reading logic into V8ScriptValueDeserializer. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
index 3c40725261c0bb0a3b53254193ca5f07bdc5e04d..9eeb224318bbed02b47351befe0467da14281b64 100644
--- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
@@ -1053,5 +1053,18 @@ TEST(V8ScriptValueSerializerTest, DecodeHardcodedNullValue) {
->IsNull());
}
+// This is not the most efficient way to write a small version, but it's
+// technically admissible. We should handle this in a consistent way to avoid
+// DCHECK failure. Thus this is "true" encoded slightly strangely.
+TEST(V8ScriptValueSerializerTest, DecodeWithInefficientVersionEnvelope) {
+ V8TestingScope scope;
+ RefPtr<SerializedScriptValue> input =
+ serializedValue({0xff, 0x80, 0x09, 0xff, 0x09, 0x54});
+ EXPECT_TRUE(
+ V8ScriptValueDeserializer(scope.getScriptState(), std::move(input))
+ .deserialize()
+ ->IsTrue());
+}
+
} // namespace
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698