From 0f248fed2e89451bff757e2d3cd0d281647197b4 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 8 Jan 2020 13:18:18 +0000 Subject: [PATCH] Bug 1603802 [wpt PR 20771] - Add/update tests for cross-realm Error serialization, a=testonly Automatic update from web-platform-tests Add/update tests for cross-realm Error serialization Follows https://github.com/whatwg/html/pull/5150. -- wpt-commits: 9882946dd9fcf7251387c2bfc778331b7ae85846 wpt-pr: 20771 --- .../resources/post-parent-type-error.html | 9 ++++ .../structured-cloning-error-extra.html | 46 +++++++++++++++++++ .../structuredclone_0.html | 14 +++--- 3 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html new file mode 100644 index 0000000000000..d6713c4192e57 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html @@ -0,0 +1,9 @@ + + +Helper that posts its parent a TypeError + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html new file mode 100644 index 0000000000000..5ff10cbc10e8f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html @@ -0,0 +1,46 @@ + + +Structured cloning of Error objects: extra tests + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html index babf514bf9e4d..fbb48db03838a 100644 --- a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html @@ -498,12 +498,12 @@ }); }, function() { - var t = async_test("URIError objects from other realms are treated as Error"); + var t = async_test("URIError objects from other realms are treated as URIError"); t.id = 35; worker.onmessage = t.step_func_done(function(e) { - assert_equals(Object.getPrototypeOf(e.data), Error.prototype, "Checking prototype"); - assert_equals(e.data.constructor, Error, "Checking constructor"); - assert_equals(e.data.name, "Error", "Checking name"); + assert_equals(Object.getPrototypeOf(e.data), URIError.prototype, "Checking prototype"); + assert_equals(e.data.constructor, URIError, "Checking constructor"); + assert_equals(e.data.name, "URIError", "Checking name"); assert_equals(e.data.message, "some message", "Checking message"); assert_equals(e.data.foo, undefined, "Checking custom property"); }); @@ -520,9 +520,9 @@ var t = async_test("Cloning a modified Error"); t.id = 36; worker.onmessage = t.step_func_done(function(e) { - assert_equals(Object.getPrototypeOf(e.data), SyntaxError.prototype, "Checking prototype"); - assert_equals(e.data.constructor, SyntaxError, "Checking constructor"); - assert_equals(e.data.name, "SyntaxError", "Checking name"); + assert_equals(Object.getPrototypeOf(e.data), TypeError.prototype, "Checking prototype"); + assert_equals(e.data.constructor, TypeError, "Checking constructor"); + assert_equals(e.data.name, "TypeError", "Checking name"); assert_equals(e.data.message, "another message", "Checking message"); assert_equals(e.data.foo, undefined, "Checking custom property"); });