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

Unified Diff: LayoutTests/fast/js/structured-clone.html

Issue 1185703009: Work In Progress: Handle Maps and Sets in Structured Clone (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « no previous file | Source/bindings/core/v8/ScriptValueSerializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/js/structured-clone.html
diff --git a/LayoutTests/fast/js/structured-clone.html b/LayoutTests/fast/js/structured-clone.html
index 6cd9c365878d5340ae30ced8ce4297c7a39f3dde..7d5ae25011b17ab6a0e3439c91a949240edf6cb0 100644
--- a/LayoutTests/fast/js/structured-clone.html
+++ b/LayoutTests/fast/js/structured-clone.html
@@ -119,4 +119,21 @@ promise_test(function() {
});
}, 'Verify: "Add a new property..." (dense arrays)');
+promise_test(function() {
+ var orig = {
+ emptySet: new Set,
+ set: new Set([1, 2, 3]),
+ emptyMap: new Map,
+ map: new Map([[1, 2], [3, 4]])
+ };
+ return structuredClone(orig).then(function(clone) {
+ assert_true(clone.emptySet instanceof Set, 'Clone should be a Set');
+ assert_true(clone.emptyMap instanceof Map, 'Clone should be a Map');
+ assert_true(clone.set instanceof Set, 'Clone should be a Set');
+ assert_true(clone.map instanceof Map, 'Clone should be a Map');
+ assert_equals(clone.set.size, orig.set.size, 'Clone should be the same size');
+ assert_equals(clone.map.size, orig.map.size, 'Clone should be the same size');
+ });
+}, 'Verify: "Maps and Sets are cloned..."');
+
</script>
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptValueSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698