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

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

Issue 2742713004: Check for invalid element id when deserializing CompositorProxyTag (Closed)
Patch Set: Address nits Created 3 years, 9 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 3a65dea94ea9f6095bbe67b08f633547c20f7d52..40d3e36cca93bb45cb45c46824a67df611f7030e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
@@ -1034,6 +1034,22 @@ TEST(V8ScriptValueSerializerTest, RoundTripCompositorProxy) {
newProxy->compositorMutableProperties());
}
+TEST(V8ScriptValueSerializerTest, CompositorProxyBadElementDeserialization) {
+ ScopedEnableCompositorWorker enableCompositorWorker;
+ V8TestingScope scope;
+
+ // Normally a CompositorProxy will not be constructed with an element id of 0,
+ // but we force it here to test the deserialization code.
+ uint8_t elementId = 0;
+ uint8_t mutableProperties = CompositorMutableProperty::kOpacity;
+ RefPtr<SerializedScriptValue> input = serializedValue(
+ {0xff, 0x09, 0x3f, 0x00, 0x43, elementId, mutableProperties, 0x00});
+ v8::Local<v8::Value> result =
+ V8ScriptValueDeserializer(scope.getScriptState(), input).deserialize();
+
+ EXPECT_TRUE(result->IsNull());
+}
+
// Decode tests aren't included here because they're slightly non-trivial (an
// element with the right ID must actually exist) and this feature is both
// unshipped and likely to not use this mechanism when it does.
« 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