diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-05-17 11:35:28 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-05-22 18:36:41 +0800 |
commit | a5aad244b1fa3a00010eb60e934ce2cd56492f39 (patch) | |
tree | 39ef4834af561f7d57b89aef072871bed3e7c0bc /test/fixtures | |
parent | 16377146b6ef24130c3a8ae1657328eaafb963ff (diff) | |
download | android-node-v8-a5aad244b1fa3a00010eb60e934ce2cd56492f39.tar.gz android-node-v8-a5aad244b1fa3a00010eb60e934ce2cd56492f39.tar.bz2 android-node-v8-a5aad244b1fa3a00010eb60e934ce2cd56492f39.zip |
test: test about:blank against invalid WHATWG URL
> If `failure` is true, parsing `about:blank` against `base`
> must give failure. This tests that the logic for converting
> base URLs into strings properly fails the whole parsing
> algorithm if the base URL cannot be parsed.
Fixes: https://github.com/nodejs/node/issues/20720
PR-URL: https://github.com/nodejs/node/pull/20796
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/url-tests.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/test/fixtures/url-tests.js b/test/fixtures/url-tests.js index 745adb8d8a..48533ed090 100644 --- a/test/fixtures/url-tests.js +++ b/test/fixtures/url-tests.js @@ -2,7 +2,7 @@ /* The following tests are copied from WPT. Modifications to them should be upstreamed first. Refs: - https://github.com/w3c/web-platform-tests/blob/ed4bb727ed/url/urltestdata.json + https://github.com/w3c/web-platform-tests/blob/88b75886e/url/urltestdata.json License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html */ module.exports = @@ -6529,28 +6529,35 @@ module.exports = "search": "?a", "hash": "#%GH" }, - "Bad bases", + "URLs that require a non-about:blank base. (Also serve as invalid base tests.)", { - "input": "test-a.html", - "base": "a", + "input": "a", + "base": "about:blank", "failure": true }, { - "input": "test-a-slash.html", - "base": "a/", + "input": "a/", + "base": "about:blank", "failure": true }, { - "input": "test-a-slash-slash.html", - "base": "a//", + "input": "a//", + "base": "about:blank", "failure": true }, + "Bases that don't fail to parse but fail to be bases", { "input": "test-a-colon.html", "base": "a:", "failure": true }, { + "input": "test-a-colon-b.html", + "base": "a:b", + "failure": true + }, + "Other base URL tests, that must succeed", + { "input": "test-a-colon-slash.html", "base": "a:/", "href": "a:/test-a-colon-slash.html", @@ -6579,11 +6586,6 @@ module.exports = "hash": "" }, { - "input": "test-a-colon-b.html", - "base": "a:b", - "failure": true - }, - { "input": "test-a-colon-slash-b.html", "base": "a:/b", "href": "a:/test-a-colon-slash-b.html", |