From a8d20add4b2c6fad42525b0e1d9ed38864cb2269 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Thu, 18 Jul 2019 10:18:05 -0700 Subject: [PATCH] Fix and re-enable web tests affected by Error structured cloning Fix tests and expectations for Error structured cloning Spec: https://github.com/whatwg/html/pull/4665 Intent-to-Ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/f8JngIi8qYs Bug: 970079 Change-Id: I5f3eb0c5f1a2aee11f1ec668bd9bfe1e0f6ace2e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703530 Commit-Queue: Yutaka Hirano Reviewed-by: Joshua Bell Reviewed-by: Majid Valipour Cr-Commit-Position: refs/heads/master@{#678728} --- animation-worklet/stateful-animator.https.html | 2 +- html/browsers/history/the-history-interface/001.html | 7 +++---- html/browsers/history/the-history-interface/002.html | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/animation-worklet/stateful-animator.https.html b/animation-worklet/stateful-animator.https.html index dba3aa8dc8dfa6f..b83590650b19756 100644 --- a/animation-worklet/stateful-animator.https.html +++ b/animation-worklet/stateful-animator.https.html @@ -89,7 +89,7 @@ effect.localTime = this.test_local_time++; } state() { - return new Error('foo'); + return new Symbol('foo'); } }); diff --git a/html/browsers/history/the-history-interface/001.html b/html/browsers/history/the-history-interface/001.html index 7273593547964e9..ac8c8000777474d 100644 --- a/html/browsers/history/the-history-interface/001.html +++ b/html/browsers/history/the-history-interface/001.html @@ -175,11 +175,10 @@ }, 'pushState must not be able to use a DOM node as data'); test(function () { try { a.b = c; } catch(errdata) { - assert_throws( 'DATA_CLONE_ERR', function () { - history.pushState({dummy:errdata},''); - } ); + history.pushState({dummy:errdata},''); + assert_equals(ReferenceError.prototype, Object.getPrototypeOf(history.state.dummy)); } - }, 'pushState must not be able to use an error object as data'); + }, 'pushState must be able to use an error object as data'); test(function () { assert_throws( 'DATA_CLONE_ERR', function () { iframe.contentWindow.history.pushState(document,''); diff --git a/html/browsers/history/the-history-interface/002.html b/html/browsers/history/the-history-interface/002.html index c5bae3407c89989..431f6a58634f9d0 100644 --- a/html/browsers/history/the-history-interface/002.html +++ b/html/browsers/history/the-history-interface/002.html @@ -156,11 +156,10 @@ }, 'replaceState must not be able to use a DOM node as data'); test(function () { try { a.b = c; } catch(errdata) { - assert_throws( 'DATA_CLONE_ERR', function () { - history.replaceState({dummy:errdata},''); - } ); + history.replaceState({dummy:errdata},''); + assert_equals(ReferenceError.prototype, Object.getPrototypeOf(history.state.dummy)); } - }, 'replaceState must not be able to use an error object as data'); + }, 'replaceState must be able to use an error object as data'); test(function () { assert_throws( 'DATA_CLONE_ERR', function () { iframe.contentWindow.history.replaceState(document,'');