haikuwebkit/LayoutTests/fetch/header-constructor-is-array...

31 lines
662 B
HTML
Raw Permalink Normal View History

<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<iframe></iframe>
<script>
[WebIDL] Remove JS builtin bindings for FetchHeaders https://bugs.webkit.org/show_bug.cgi?id=174905 Patch by Sam Weinig <sam@webkit.org> on 2017-07-28 Reviewed by Alex Christensen. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/headers/headers-basic-expected.txt: * web-platform-tests/fetch/api/headers/headers-record-expected.txt: Update results for more passing tests. Source/WebCore: * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/FetchHeaders.js: Removed. Remove FetchHeaders.js * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::append): * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): Add create function for generated constructor. Add appendToHeaderMap static function which takes the functionality from the existing append function, and makes it useable in create. * Modules/fetch/FetchHeaders.idl: Replace [JSBuiltinConstructor] with real constructor. Keep other builtin attributes as they are still used by other Fetch code. * bindings/js/JSDOMConvertRecord.h: Fix record conversion to work with proxies by changing to use the method table for getOwnPropertyNames, and undefined values by not excluding undefined values. LayoutTests: * fetch/header-constructor-is-array-expected.txt: * fetch/header-constructor-is-array.html: Update test to match spec. An array with out a prototype will not yield a valid Header as it is not iterable. Canonical link: https://commits.webkit.org/191755@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-29 02:35:56 +00:00
description("This test should create a Headers with strange Arrays.");
{
let array = [ [ 'hello', 'world' ] ];
array.__proto__ = null;
var headers = new Headers(array);
[WebIDL] Remove JS builtin bindings for FetchHeaders https://bugs.webkit.org/show_bug.cgi?id=174905 Patch by Sam Weinig <sam@webkit.org> on 2017-07-28 Reviewed by Alex Christensen. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/headers/headers-basic-expected.txt: * web-platform-tests/fetch/api/headers/headers-record-expected.txt: Update results for more passing tests. Source/WebCore: * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/FetchHeaders.js: Removed. Remove FetchHeaders.js * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::append): * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): Add create function for generated constructor. Add appendToHeaderMap static function which takes the functionality from the existing append function, and makes it useable in create. * Modules/fetch/FetchHeaders.idl: Replace [JSBuiltinConstructor] with real constructor. Keep other builtin attributes as they are still used by other Fetch code. * bindings/js/JSDOMConvertRecord.h: Fix record conversion to work with proxies by changing to use the method table for getOwnPropertyNames, and undefined values by not excluding undefined values. LayoutTests: * fetch/header-constructor-is-array-expected.txt: * fetch/header-constructor-is-array.html: Update test to match spec. An array with out a prototype will not yield a valid Header as it is not iterable. Canonical link: https://commits.webkit.org/191755@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-29 02:35:56 +00:00
shouldBeNull("headers.get('hello')");
}
{
// From the other realm.
let frame = frames[0];
let array = new frame.Array();
array.push([ 'hello', 'world' ]);
var headers = new Headers(array);
shouldBeEqualToString("headers.get('hello')", "world");
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>