Changeset 260670 in webkit
- Timestamp:
- Apr 24, 2020 2:41:32 PM (4 years ago)
- Location:
- trunk/LayoutTests/imported/w3c
- Files:
-
- 24 added
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r260662 r260670 1 2020-04-24 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Re-sync wpt/WebIDL/ecmascript-binding and wpt/custom-elements/htmlconstructor from upstream 4 https://bugs.webkit.org/show_bug.cgi?id=210984 5 6 Reviewed by Darin Adler. 7 8 web-platform-tests revision: 39e9c51041a1 9 10 * web-platform-tests/WebIDL/ecmascript-binding/*: Updated. 11 * web-platform-tests/custom-elements/htmlconstructor/*: Updated. 12 1 13 2020-04-24 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.js
r219598 r260670 2 2 3 3 test(() => { 4 assert_throws (new TypeError(), () => DOMException());4 assert_throws_js(TypeError, () => DOMException()); 5 5 }, "Cannot construct without new"); 6 6 … … 27 27 const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "message").get; 28 28 29 assert_throws (new TypeError(), () => getter.apply({}));29 assert_throws_js(TypeError, () => getter.apply({})); 30 30 }, "message getter performs brand checks (i.e. is not [LenientThis]"); 31 31 … … 44 44 const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "name").get; 45 45 46 assert_throws (new TypeError(), () => getter.apply({}));46 assert_throws_js(TypeError, () => getter.apply({})); 47 47 }, "name getter performs brand checks (i.e. is not [LenientThis]"); 48 48 … … 61 61 const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "code").get; 62 62 63 assert_throws (new TypeError(), () => getter.apply({}));63 assert_throws_js(TypeError, () => getter.apply({})); 64 64 }, "code getter performs brand checks (i.e. is not [LenientThis]"); 65 65 … … 99 99 100 100 test(() => { 101 assert_throws (new TypeError(), () => DOMException.prototype.toString());101 assert_throws_js(TypeError, () => DOMException.prototype.toString()); 102 102 }, "DOMException.prototype.toString() applied to DOMException.prototype throws because of name/message brand checks"); 103 103 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html
r219598 r260670 10 10 * This file just picks one case where browsers are supposed to throw an 11 11 * exception, and tests the heck out of whether it meets the spec. In the 12 * future, all these checks should be in assert_throws (), but we don't want13 * every browser failing every assert_throws () check until they fix every12 * future, all these checks should be in assert_throws_dom(), but we don't want 13 * every browser failing every assert_throws_dom() check until they fix every 14 14 * single bug in their exception-throwing. 15 15 * -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/global-immutable-prototype.any.js
r253783 r260670 11 11 test(() => { 12 12 for (const object of objects) { 13 assert_throws (new TypeError(), () => {13 assert_throws_js(TypeError, () => { 14 14 Object.setPrototypeOf(object, {}); 15 15 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-prototype-object-expected.txt
r253783 r260670 1 1 2 FAIL The class string of an interface prototype object is the concatenation of the interface's identifier and the string 'Prototype'. assert_true: An interface prototype object should have toStringTag property. expected true got false3 2 PASS [Unscopable] extended attribute makes @@unscopables object on the prototype object, whose prototype is null. 4 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-prototype-object.html
r253783 r260670 6 6 <script src="/resources/testharnessreport.js"></script> 7 7 <script> 8 // A specification issue was raised for this behavior.9 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=2824410 test(function() {11 // Checks toString() behavior.12 assert_class_string(Document.prototype, "DocumentPrototype");13 14 assert_true(Document.prototype.hasOwnProperty(Symbol.toStringTag),15 "An interface prototype object should have toStringTag property.");16 assert_equals(Document.prototype[Symbol.toStringTag], "DocumentPrototype");17 }, "The class string of an interface prototype object is the concatenation of " +18 "the interface's identifier and the string 'Prototype'.");19 20 8 test(function() { 21 9 // https://heycam.github.io/webidl/#create-an-interface-prototype-object -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object-expected.txt
r253855 r260670 3 3 PASS next() exists and is writable, enumerable, and configurable 4 4 PASS next() throws TypeError when called on ineligible receiver 5 PASS Object.prototype.toString returns correct value6 PASS @@toStringTag has correct value7 5 PASS Is specific to an interface 8 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object.html
r232641 r260670 24 24 const iteratorProto = Object.getPrototypeOf(usp.entries()); 25 25 26 assert_throws (new TypeError(), () => {26 assert_throws_js(TypeError, () => { 27 27 iteratorProto.next(); 28 28 }); 29 assert_throws (new TypeError(), () => {29 assert_throws_js(TypeError, () => { 30 30 iteratorProto.next.call(undefined); 31 31 }); 32 assert_throws (new TypeError(), () => {32 assert_throws_js(TypeError, () => { 33 33 iteratorProto.next.call(42); 34 34 }); 35 assert_throws (new TypeError(), () => {35 assert_throws_js(TypeError, () => { 36 36 iteratorProto.next.call(new Headers().entries()); 37 37 }); 38 38 }, "next() throws TypeError when called on ineligible receiver"); 39 39 40 test(() => { 41 const iteratorProto = Object.getPrototypeOf(new URLSearchParams().entries()); 42 assert_equals(Object.prototype.toString.call(iteratorProto), "[object URLSearchParams Iterator]"); 43 }, "Object.prototype.toString returns correct value"); 44 45 test(() => { 46 const iteratorProto = Object.getPrototypeOf(new URLSearchParams().entries()); 47 assert_equals(Object.getOwnPropertyDescriptor(iteratorProto, Symbol.toStringTag).value, "URLSearchParams Iterator"); 48 // Property attributes have not yet been fully spec'd. 49 }, "@@toStringTag has correct value"); 40 // class string behavior tested in a dedicated file 50 41 51 42 test(() => { -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/legacy-callback-interface-object.html
r217225 r260670 24 24 25 25 test(() => { 26 assert_throws (new TypeError(), () => NodeFilter(), "call");27 assert_throws (new TypeError(), () => new NodeFilter(), "construct");26 assert_throws_js(TypeError, () => NodeFilter(), "call"); 27 assert_throws_js(TypeError, () => new NodeFilter(), "construct"); 28 28 }, "Must throw a TypeError when called or constructed") 29 29 … … 60 60 // OrdinaryHasInstance throws a TypeError if the right-hand-side doesn't have a .prototype object, 61 61 // which is the case for callback interfaces. 62 assert_throws (new TypeError(), () => {62 assert_throws_js(TypeError, () => { 63 63 (function () { }) instanceof NodeFilter; 64 64 }); 65 assert_throws (new TypeError(), () => {65 assert_throws_js(TypeError, () => { 66 66 ({ }) instanceof NodeFilter; 67 67 }); -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/put-forwards-expected.txt
r217895 r260670 6 6 PASS Exception propagation from setter of [PutForwards] target attribute 7 7 PASS TypeError when getter of [PutForwards] attribute returns non-object 8 PASS Does not throw when setter of [PutForwards] attribute returns false 9 PASS Setting a.relList to noreferrer is reflected in rel 10 PASS Setting area.relList to noreferrer is reflected in rel 11 FAIL Setting form.relList to noreferrer is reflected in rel assert_true: The attribute is a DOMTokenList expected true got false 12 PASS Setting link.relList to stylesheet is reflected in rel 8 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/put-forwards.html
r217225 r260670 78 78 }); 79 79 80 assert_throws (new SyntaxError(), () => {80 assert_throws_js(SyntaxError, () => { 81 81 element.style = "color: green"; 82 82 }); … … 95 95 }); 96 96 97 assert_throws (new SyntaxError(), () => {97 assert_throws_js(SyntaxError, () => { 98 98 element.style = "color: green"; 99 99 }); … … 111 111 }); 112 112 113 assert_throws (new TypeError(), () => {113 assert_throws_js(TypeError, () => { 114 114 element.style = "color: green"; 115 115 }); 116 116 }, "TypeError when getter of [PutForwards] attribute returns non-object"); 117 118 119 test(() => { 120 var element = document.createElement("div"); 121 122 var element_style = element.style; 123 Object.defineProperty(element.style, "cssText", { 124 value: null, 125 writable: false, 126 }); 127 128 element.style = "color: green"; 129 assert_equals(element.style, element_style); 130 assert_equals(element.style.cssText, null); 131 }, "Does not throw when setter of [PutForwards] attribute returns false"); 132 133 function test_token_list(elementName, attribute, target, value) { 134 test(() => { 135 var element=document.createElement(elementName); 136 assert_true(element[attribute] instanceof DOMTokenList,"The attribute is a DOMTokenList"); 137 element[attribute]=value; 138 assert_equals(element.getAttribute(target),value,"Setting the attribute is reflected in the target"); 139 element[attribute]=""; 140 assert_equals(element.getAttribute(target),"","Clearing the attribute is reflected in the target"); 141 },"Setting "+elementName+"."+attribute+" to "+value+" is reflected in "+target) 142 } 143 144 test_token_list("a","relList","rel","noreferrer"); 145 test_token_list("area","relList","rel","noreferrer"); 146 test_token_list("form","relList","rel","noreferrer"); 147 test_token_list("link","relList","rel","stylesheet"); 117 148 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/sequence-conversion.html
r253783 r260670 152 152 test(t => { 153 153 // Should fail rather than falling back to record 154 assert_throws (new TypeError(), function() { new URLSearchParams(["key", "value"]); });154 assert_throws_js(TypeError, function() { new URLSearchParams(["key", "value"]); }); 155 155 }, "A string array in sequence<sequence> or record"); 156 156 -
trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/w3c-import.log
r253783 r260670 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js 18 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js 19 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window.js 17 20 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/constructors.html 18 21 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-iterator-object.html … … 24 27 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object.html 25 28 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/legacy-callback-interface-object.html 26 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/legacy-platform-object.html27 29 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/no-regexp-special-casing.any.js 28 30 /LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/put-forwards.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget-expected.txt
r234957 r260670 3 3 PASS Rethrow any exceptions thrown while getting the prototype 4 4 PASS If prototype is not object (null), derives the fallback from NewTarget's realm (autonomous custom elements) 5 FAIL If prototype is not object (null), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements) assert_equals: Must use the HTMLElement from the realm of NewTarget expected object "[object HTMLElementPrototype]" but got object "[object HTMLElementPrototype]" 5 6 PASS If prototype is not object (undefined), derives the fallback from NewTarget's realm (autonomous custom elements) 7 FAIL If prototype is not object (undefined), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements) assert_equals: Must use the HTMLElement from the realm of NewTarget expected object "[object HTMLElementPrototype]" but got object "[object HTMLElementPrototype]" 6 8 PASS If prototype is not object (5), derives the fallback from NewTarget's realm (autonomous custom elements) 9 FAIL If prototype is not object (5), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements) assert_equals: Must use the HTMLElement from the realm of NewTarget expected object "[object HTMLElementPrototype]" but got object "[object HTMLElementPrototype]" 7 10 PASS If prototype is not object (string), derives the fallback from NewTarget's realm (autonomous custom elements) 11 FAIL If prototype is not object (string), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements) assert_equals: Must use the HTMLElement from the realm of NewTarget expected object "[object HTMLElementPrototype]" but got object "[object HTMLElementPrototype]" 8 12 FAIL If prototype is not object (null), derives the fallback from NewTarget's realm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 13 FAIL If prototype is not object (null), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 9 14 FAIL If prototype is not object (undefined), derives the fallback from NewTarget's realm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 15 FAIL If prototype is not object (undefined), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 10 16 FAIL If prototype is not object (5), derives the fallback from NewTarget's realm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 17 FAIL If prototype is not object (5), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 11 18 FAIL If prototype is not object (string), derives the fallback from NewTarget's realm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 19 FAIL If prototype is not object (string), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements) promise_test: Unhandled rejection with value: object "TypeError: Reflect.construct requires the first argument be a constructor" 12 20 PASS HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling proxy constructor directly 13 21 PASS HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling via Reflect -
trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html
r234039 r260670 41 41 let throws = false; 42 42 43 let err = { name: "prototype throws" }; 43 44 function TestElement() { 44 45 throws = true; 45 assert_throws ({ name: "prototype throws" }, () => {46 assert_throws_exactly(err, () => { 46 47 Reflect.construct(w.HTMLElement, [], new.target); 47 48 }); … … 51 52 get: function (target, name) { 52 53 if (throws && name == "prototype") 53 throw { name: "prototype throws" };54 throw err; 54 55 return target[name]; 55 56 } … … 92 93 new ElementWithDynamicPrototype(); 93 94 }, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's realm (autonomous custom elements)"); 95 96 test_with_window(w => { 97 // We have to return an object during define(), but not during super() 98 let returnNotAnObject = false; 99 100 function TestElement() { 101 const o = Reflect.construct(w.HTMLElement, [], new.target); 102 103 assert_equals(Object.getPrototypeOf(new.target), window.Function.prototype); 104 assert_equals(Object.getPrototypeOf(o), window.HTMLElement.prototype, 105 "Must use the HTMLElement from the realm of NewTarget"); 106 assert_not_equals(Object.getPrototypeOf(o), w.HTMLElement.prototype, 107 "Must not use the HTMLElement from the realm of the active function object (w.HTMLElement)"); 108 109 return o; 110 } 111 112 // Create the proxy in the subframe, which should not affect what our 113 // prototype ends up as. 114 const ElementWithDynamicPrototype = new w.Proxy(TestElement, { 115 get: function (target, name) { 116 if (name == "prototype") 117 return returnNotAnObject ? notAnObject : {}; 118 return target[name]; 119 } 120 }); 121 122 w.customElements.define("test-element", ElementWithDynamicPrototype); 123 124 returnNotAnObject = true; 125 new ElementWithDynamicPrototype(); 126 }, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's GetFunctionRealm (autonomous custom elements)"); 94 127 }); 95 128 … … 123 156 new ElementWithDynamicPrototype(); 124 157 }, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's realm (customized built-in elements)"); 158 159 test_with_window(w => { 160 // We have to return an object during define(), but not during super() 161 let returnNotAnObject = false; 162 163 function TestElement() { 164 const o = Reflect.construct(w.HTMLParagraphElement, [], new.target); 165 166 assert_equals(Object.getPrototypeOf(o), window.HTMLParagraphElement.prototype, 167 "Must use the HTMLParagraphElement from the realm of NewTarget"); 168 assert_not_equals(Object.getPrototypeOf(o), w.HTMLParagraphElement.prototype, 169 "Must not use the HTMLParagraphElement from the realm of the active function object (w.HTMLParagraphElement)"); 170 171 return o; 172 } 173 174 // Create the proxy in the subframe, which should not affect what our 175 // prototype ends up as. 176 const ElementWithDynamicPrototype = new w.Proxy(TestElement, { 177 get: function (target, name) { 178 if (name == "prototype") 179 return returnNotAnObject ? notAnObject : {}; 180 return target[name]; 181 } 182 }); 183 184 w.customElements.define("test-element", ElementWithDynamicPrototype, { extends: "p" }); 185 186 returnNotAnObject = true; 187 new ElementWithDynamicPrototype(); 188 }, "If prototype is not object (" + notAnObject + "), derives the fallback from NewTarget's GetFunctionRealm (customized built-in elements)"); 125 189 }); 126 190 … … 140 204 // reset the counter. 141 205 getCount = 0; 142 assert_throws ({'name': 'TypeError'},143 function () { new countingProxy() },144 "Should not be able to construct an HTMLParagraphElement not named 'p'");206 assert_throws_js(TypeError, 207 function () { new countingProxy() }, 208 "Should not be able to construct an HTMLParagraphElement not named 'p'"); 145 209 assert_equals(getCount, 0, "Should never have gotten .prototype"); 146 210 }, 'HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling proxy constructor directly'); … … 161 225 // reset the counter. 162 226 getCount = 0; 163 assert_throws ({'name': 'TypeError'},164 function () { Reflect.construct(HTMLParagraphElement, [], countingProxy) },165 "Should not be able to construct an HTMLParagraphElement not named 'p'");227 assert_throws_js(TypeError, 228 function () { Reflect.construct(HTMLParagraphElement, [], countingProxy) }, 229 "Should not be able to construct an HTMLParagraphElement not named 'p'"); 166 230 assert_equals(getCount, 0, "Should never have gotten .prototype"); 167 231 }, 'HTMLParagraphElement constructor must not get .prototype until it finishes its extends sanity checks, calling via Reflect');
Note: See TracChangeset
for help on using the changeset viewer.