-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1823131 [wpt PR 39069] - URL: URL.canParse(), a=testonly
Automatic update from web-platform-tests URL: URL.canParse() For whatwg/url#763. -- wpt-commits: 7c5c3cc125979b4768d414471e6ab655b473aae8 wpt-pr: 39069
- Loading branch information
1 parent
c706e04
commit dd894b2
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
testing/web-platform/tests/url/url-statics-canparse.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// This intentionally does not use resources/urltestdata.json to preserve resources. | ||
[ | ||
{ | ||
"url": undefined, | ||
"base": undefined, | ||
"expected": false | ||
}, | ||
{ | ||
"url": "a:b", | ||
"base": undefined, | ||
"expected": true | ||
}, | ||
{ | ||
"url": undefined, | ||
"base": "a:b", | ||
"expected": false | ||
}, | ||
{ | ||
"url": "a:/b", | ||
"base": undefined, | ||
"expected": true | ||
}, | ||
{ | ||
"url": undefined, | ||
"base": "a:/b", | ||
"expected": true | ||
}, | ||
{ | ||
"url": "https://test:test", | ||
"base": undefined, | ||
"expected": false | ||
}, | ||
{ | ||
"url": "a", | ||
"base": "https://b/", | ||
"expected": true | ||
} | ||
].forEach(({ url, base, expected }) => { | ||
test(() => { | ||
assert_equals(URL.canParse(url, base), expected); | ||
}, `URL.canParse(${url}, ${base})`); | ||
}); |