summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html')
-rw-r--r--third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html183
1 files changed, 183 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html
index b4f6a3c..7494a5c 100644
--- a/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html
+++ b/third_party/WebKit/LayoutTests/fast/storage/serialized-script-value.html
@@ -17,6 +17,18 @@ function testSerialization(obj, values, oldFormat, serializeExceptionValue) {
testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
+ 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
+ 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
+ 0x6f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
+ 0x61, 0x00, 0x72, 0x00, 0x02, 0x03, 0x00, 0x00,
+ 0x00, 0x62, 0x00, 0x61, 0x00, 0x7a, 0x00, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x79, 0x00,
+ 0x4e, 0x00, 0x65, 0x00, 0x77, 0x00, 0x4b, 0x00,
+ 0x65, 0x00, 0x79, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
@@ -31,6 +43,16 @@ testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}},
testSerialization({foo: 'zoo', bar: 'myNewKey'},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
+ 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
+ 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
+ 0x6f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
+ 0x61, 0x00, 0x72, 0x00, 0x10, 0x08, 0x00, 0x00,
+ 0x00, 0x6d, 0x00, 0x79, 0x00, 0x4e, 0x00, 0x65,
+ 0x00, 0x77, 0x00, 0x4b, 0x00, 0x65, 0x00, 0x79,
+ 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
@@ -43,11 +65,21 @@ testSerialization({foo: 'zoo', bar: 'myNewKey'},
testSerialization([],
[
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff
]);
testSerialization({foo: "zoo"},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
+ 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
+ 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
+ 0x6f, 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
@@ -55,6 +87,11 @@ testSerialization({foo: "zoo"},
]);
testSerialization({foo: null},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
+ 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x04,
+ 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x04,
0xff, 0xff, 0xff, 0xff
@@ -62,63 +99,113 @@ testSerialization({foo: null},
testSerialization({},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff,
+ 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff,
0xff
]);
testSerialization(undefined,
[
+ 0x04, 0x00, 0x00, 0x00, 0x03
+],
+[
0x03, 0x00, 0x00, 0x00, 0x03
]);
testSerialization(true,
[
+ 0x04, 0x00, 0x00, 0x00, 0x09
+],
+[
0x03, 0x00, 0x00, 0x00, 0x09
]);
testSerialization(false,
[
+ 0x04, 0x00, 0x00, 0x00, 0x08
+],
+[
0x03, 0x00, 0x00, 0x00, 0x08
]);
testSerialization(new Array(100),
[
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff
]);
testSerialization(10,
[
+ 0x04, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00,
+ 0x00
+],
+[
0x03, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00,
0x00
]);
testSerialization(-10,
[
+ 0x04, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff,
+ 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff,
0xff
]);
testSerialization(Math.pow(2,30),
[
+ 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x40
+],
+[
0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x40
]);
testSerialization(Math.pow(2,55),
[
+ 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x60, 0x43,
+],
+[
0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x60, 0x43,
]);
testSerialization(1.23,
[
+ 0x04, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1,
+ 0x7a, 0x14, 0xae, 0xf3, 0x3f
+],
+[
0x03, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1,
0x7a, 0x14, 0xae, 0xf3, 0x3f
]);
testSerialization("",
[
+ 0x04, 0x00, 0x00, 0x00, 0x11
+],
+[
0x03, 0x00, 0x00, 0x00, 0x11
]);
testSerialization("abc",
[
+ 0x04, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
+ 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00
+],
+[
0x03, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00
]);
testSerialization({integer: 123},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00,
+ 0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x65,
+ 0x00, 0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x05,
+ 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00,
0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x65,
0x00, 0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x05,
@@ -126,6 +213,13 @@ testSerialization({integer: 123},
]);
testSerialization({string: "str"},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00,
+ 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69,
+ 0x00, 0x6e, 0x00, 0x67, 0x00, 0x10, 0x03, 0x00,
+ 0x00, 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00,
+ 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00,
0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69,
0x00, 0x6e, 0x00, 0x67, 0x00, 0x10, 0x03, 0x00,
@@ -134,6 +228,15 @@ testSerialization({string: "str"},
]);
testSerialization({list: [1,2,3]},
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
+ 0x00, 0x6c, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74,
+ 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x05,
+ 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x05, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74,
0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -144,10 +247,18 @@ testSerialization({list: [1,2,3]},
]);
testSerialization(null,
[
+ 0x04, 0x00, 0x00, 0x00, 0x04
+],
+[
0x03, 0x00, 0x00, 0x00, 0x04
]);
testSerialization(/abc/,
[
+ 0x04, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00,
+ 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x00,
+ 0x00, 0x00, 0x00
+],
+[
0x03, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00,
0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x00,
0x00, 0x00, 0x00
@@ -158,6 +269,18 @@ var outerObject = {inner: innerObject};
outerObject['outer'] = innerObject;
testSerialization(outerObject,
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
+ 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x65,
+ 0x00, 0x72, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00,
+ 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00,
+ 0x6f, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00, 0x74,
+ 0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00, 0x65,
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00,
+ 0x00, 0x6f, 0x00, 0x75, 0x00, 0x74, 0x00, 0x65,
+ 0x00, 0x72, 0x00, 0x13, 0x01, 0xff, 0xff, 0xff,
+ 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
0x00, 0x69, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x65,
0x00, 0x72, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00,
@@ -171,6 +294,13 @@ testSerialization(outerObject,
]);
testSerialization(innerObject,
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
+ 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
+ 0x00, 0x6f, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00,
+ 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00,
+ 0x65, 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
0x00, 0x6f, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00,
@@ -181,6 +311,14 @@ testSerialization(innerObject,
var unicodeObject = {a: 'a', u: String.fromCharCode(0x03B1,0x03B2), d: 42};
testSerialization(unicodeObject,
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x61, 0x00, 0x10, 0xfe, 0xff, 0xff, 0xff,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x00, 0x10,
+ 0x02, 0x00, 0x00, 0x00, 0xb1, 0x03, 0xb2, 0x03,
+ 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x05, 0x2a,
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
0x00, 0x61, 0x00, 0x10, 0xfe, 0xff, 0xff, 0xff,
0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x00, 0x10,
@@ -191,6 +329,15 @@ testSerialization(unicodeObject,
unicodeObject.a = 'ab';
testSerialization(unicodeObject,
[
+ 0x04, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
+ 0x00, 0x61, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00,
+ 0x61, 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x75, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0xb1,
+ 0x03, 0xb2, 0x03, 0x01, 0x00, 0x00, 0x00, 0x64,
+ 0x00, 0x05, 0x2a, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xff, 0xff
+],
+[
0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
0x00, 0x61, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00,
0x61, 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -200,6 +347,42 @@ testSerialization(unicodeObject,
0xff, 0xff
]);
+var arrayObject = [];
+arrayObject['a'] = true;
+arrayObject['b'] = false;
+arrayObject['foo'] = 123;
+arrayObject['bar'] = 456;
+arrayObject[''] = null;
+testSerialization(arrayObject,
+[
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xfd, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
+ 0x00, 0x61, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00,
+ 0x62, 0x00, 0x08, 0x03, 0x00, 0x00, 0x00, 0x66,
+ 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x05, 0x7b, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
+ 0x61, 0x00, 0x72, 0x00, 0x05, 0xc8, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff,
+ 0xff, 0xff
+]);
+
+arrayObject[0] = 'foo';
+arrayObject[1] = 'bar';
+testSerialization(arrayObject,
+[
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00,
+ 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
+ 0x00, 0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0xfd,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x61,
+ 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x62, 0x00,
+ 0x08, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x05, 0x7b,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01,
+ 0x05, 0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0xff, 0xff, 0xff, 0xff
+]);
+
testSerialization(function(){}, [], null, DOMException.DATA_CLONE_ERR);
</script>
<script src="../js/resources/js-test-post.js"></script>