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

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

Issue 2667553003: Revert of ValueSerializer: Distinguish between 'undefined' and an absent property. (Closed)
Patch Set: Created 3 years, 11 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 ec2df077f57021ad0e12d6f4c7c68519bbcc12dd..db663fafd83f4882b0eaf8eec4bcd07245400ea1 100644
--- a/test/unittests/value-serializer-unittest.cc
+++ b/test/unittests/value-serializer-unittest.cc
@@ -1243,36 +1243,6 @@
EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result[1])"));
EXPECT_TRUE(EvaluateScriptForResultBool("result[1][1] === true"));
});
-}
-
-TEST_F(ValueSerializerTest, RoundTripDenseArrayContainingUndefined) {
- // In previous serialization versions, this would be interpreted as an absent
- // property.
- RoundTripTest("[undefined]", [this](Local<Value> value) {
- ASSERT_TRUE(value->IsArray());
- EXPECT_EQ(1u, Array::Cast(*value)->Length());
- EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty(0)"));
- EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === undefined"));
- });
-}
-
-TEST_F(ValueSerializerTest, DecodeDenseArrayContainingUndefined) {
- // In previous versions, "undefined" in a dense array signified absence of the
- // element (for compatibility). In new versions, it has a separate encoding.
- DecodeTest({0xff, 0x09, 0x41, 0x01, 0x5f, 0x24, 0x00, 0x01},
- [this](Local<Value> value) {
- EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
- });
- DecodeTest(
- {0xff, 0x0b, 0x41, 0x01, 0x5f, 0x24, 0x00, 0x01},
- [this](Local<Value> value) {
- EXPECT_TRUE(EvaluateScriptForResultBool("0 in result"));
- EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === undefined"));
- });
- DecodeTest({0xff, 0x0b, 0x41, 0x01, 0x2d, 0x24, 0x00, 0x01},
- [this](Local<Value> value) {
- EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
- });
}
TEST_F(ValueSerializerTest, RoundTripDate) {
« 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