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

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

Issue 1297223004: ScriptValueSerializer should throw, not crash, when handling unknown types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use nullptr Created 5 years, 4 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.cpp » ('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 43796941ca9969fc0eff4ad1e104329299396b21..5262d1f4d4ab196c91dc5ca59dcd30d0a3b97f14 100644
--- a/LayoutTests/fast/js/structured-clone.html
+++ b/LayoutTests/fast/js/structured-clone.html
@@ -189,7 +189,7 @@ promise_test(function() {
var map = new Map([['key', function(){}]]);
return structuredClone(map).then(function(clone) {
assert_unreached('Should have thrown an exception');
- }).catch(function(ex) {
+ }, function(ex) {
assert_true(ex instanceof DOMException, 'Should throw a DOMException');
assert_equals(ex.code, DOMException.DATA_CLONE_ERR, 'Should be a DataCloneError');
});
@@ -199,10 +199,19 @@ promise_test(function() {
var set = new Set([function(){}]);
return structuredClone(set).then(function(clone) {
assert_unreached('Should have thrown an exception');
- }).catch(function(ex) {
+ }, function(ex) {
assert_true(ex instanceof DOMException, 'Should throw a DOMException');
assert_equals(ex.code, DOMException.DATA_CLONE_ERR, 'Should be a DataCloneError');
});
}, 'Cloning Sets should fail if they contain non-cloneable things');
+promise_test(function() {
+ return structuredClone(Symbol('foo')).then(function(clone) {
+ assert_unreached('Should have thrown an exception');
+ }, function(ex) {
+ assert_true(ex instanceof DOMException, 'Should throw a DOMException');
+ assert_equals(ex.code, DOMException.DATA_CLONE_ERR, 'Should be a DataCloneError');
+ });
+}, 'Cloning Symbols should fail');
+
</script>
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptValueSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698