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

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: 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
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..913744e919086b606a9962e013260330ef823c04 100644
--- a/LayoutTests/fast/js/structured-clone.html
+++ b/LayoutTests/fast/js/structured-clone.html
@@ -205,4 +205,13 @@ promise_test(function() {
});
}, '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');
+ }).catch(function(ex) {
jsbell 2015/08/19 01:24:11 I believe this will 'catch' the exception thrown b
adamk 2015/08/19 20:19:34 Fixed here and above to use the two-arg then().
+ 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') | Source/bindings/core/v8/ScriptValueSerializer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698