From 5fca43a254ff642e1a2668740a38306780b96974 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 4 Oct 2019 10:24:49 +0000 Subject: [PATCH] Bug 1531256 [wpt PR 15516] - custom-elements: Update CustomElementRegistry.html for 'disabledFeatures'., a=testonly Automatic update from web-platform-tests custom-elements: Update CustomElementRegistry.html for 'disabledFeatures'. This change is for https://github.com/whatwg/html/pull/4324, and a follow-up of https://github.com/web-platform-tests/wpt/pull/15123 Bug: crbug.com/905922 Change-Id: I3eceb5d21ab555c23ed877ded17d359fe004e2aa Reviewed-on: https://chromium-review.googlesource.com/c/1482361 Auto-Submit: Kent Tamura Reviewed-by: Hayato Ito Commit-Queue: Kent Tamura Cr-Commit-Position: refs/heads/master{#635380} -- wpt-commits: 1aa5413b0c0a03d3c93e07d18bf8cc78e19ca611 wpt-pr: 15516 UltraBlame original commit: e89bf41687f50e862ace8bb7077aaa06e2f6a8b9 --- .../CustomElementRegistry.html | 501 ++++++++++++++++++ 1 file changed, 501 insertions(+) diff --git a/testing/web-platform/tests/custom-elements/CustomElementRegistry.html b/testing/web-platform/tests/custom-elements/CustomElementRegistry.html index 91fde317c727..fb8895bc74ea 100644 --- a/testing/web-platform/tests/custom-elements/CustomElementRegistry.html +++ b/testing/web-platform/tests/custom-elements/CustomElementRegistry.html @@ -3176,6 +3176,10 @@ ' observedAttributes ' +6 +' +disabledFeatures +' ] ) ; @@ -3830,6 +3834,503 @@ ( ) { +var +constructor += +function +( +) +{ +} +var +calls += +[ +] +; +var +proxy += +new +Proxy +( +constructor +{ +get +: +function +( +target +name +) +{ +calls +. +push +( +name +) +; +if +( +name += += +' +disabledFeatures +' +) +throw +{ +name +: +' +expectedError +' +} +; +return +target +[ +name +] +; +} +} +) +; +assert_throws +( +{ +' +name +' +: +' +expectedError +' +} +( +) += +> +customElements +. +define +( +' +element +- +with +- +throwing +- +disabled +- +features +' +proxy +) +) +; +assert_array_equals +( +calls +[ +' +prototype +' +' +disabledFeatures +' +] +' +customElements +. +define +must +get +" +prototype +" +and +" +disabledFeatures +" +on +the +constructor +' +) +; +} +' +customElements +. +define +must +rethrow +an +exception +thrown +while +getting +disabledFeatures +on +the +constructor +prototype +' +) +; +test +( +function +( +) +{ +var +constructor += +function +( +) +{ +} +var +calls += +[ +] +; +var +proxy += +new +Proxy +( +constructor +{ +get +: +function +( +target +name +) +{ +calls +. +push +( +name +) +; +if +( +name += += +' +disabledFeatures +' +) +return +1 +; +return +target +[ +name +] +; +} +} +) +; +assert_throws +( +{ +' +name +' +: +' +TypeError +' +} +( +) += +> +customElements +. +define +( +' +element +- +with +- +invalid +- +disabled +- +features +' +proxy +) +) +; +assert_array_equals +( +calls +[ +' +prototype +' +' +disabledFeatures +' +] +' +customElements +. +define +must +get +" +prototype +" +and +" +disabledFeatures +" +on +the +constructor +' +) +; +} +' +customElements +. +define +must +rethrow +an +exception +thrown +while +converting +the +value +of +disabledFeatures +to +sequence +< +DOMString +> +' +) +; +test +( +function +( +) +{ +var +constructor += +function +( +) +{ +} +constructor +. +disabledFeatures += +{ +[ +Symbol +. +iterator +] +: +function +* +( +) +{ +yield +' +foo +' +; +throw +{ +name +: +' +SomeError +' +} +; +} +} +; +assert_throws +( +{ +' +name +' +: +' +SomeError +' +} +( +) += +> +customElements +. +define +( +' +element +- +with +- +generator +- +disabled +- +features +' +constructor +) +) +; +} +' +customElements +. +define +must +rethrow +an +exception +thrown +while +iterating +over +disabledFeatures +to +sequence +< +DOMString +> +' +) +; +test +( +function +( +) +{ +var +constructor += +function +( +) +{ +} +constructor +. +disabledFeatures += +{ +[ +Symbol +. +iterator +] +: +1 +} +; +assert_throws +( +{ +' +name +' +: +' +TypeError +' +} +( +) += +> +customElements +. +define +( +' +element +- +with +- +disabled +- +features +- +with +- +uncallable +- +iterator +' +constructor +) +) +; +} +' +customElements +. +define +must +rethrow +an +exception +thrown +while +retrieving +Symbol +. +iterator +on +disabledFeatures +' +) +; +test +( +function +( +) +{ class MyCustomElement extends