Commit Graph

31 Commits (017661768a00d11d07a3004b83fbb2b45318b5fc)

Author SHA1 Message Date
Michaël Zasso 6b289853b2
buffer: make Blob's slice method more spec-compliant
PR-URL: https://github.com/nodejs/node/pull/37361
Fixes: https://github.com/nodejs/node/issues/37335
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-17 14:07:57 +01:00
Michael Dawson 9603e4a08d test: update to improve terminology
Update common section in wpt to incorporate
improved terminology fixed upstream in
https://github.com/web-platform-tests/wpt/pull/27152

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/37011
Reviewed-By: Milad Fa <mfarazma@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-01-26 19:08:36 -08:00
Michaël Zasso 7be72850d3
test: add wpt tests for Blob
PR-URL: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-18 13:55:27 -08:00
Daijiro Wachi d6d4721f3b test: update wpt url and resource
Refs: https://github.com/web-platform-tests/wpt/pull/26317

PR-URL: https://github.com/nodejs/node/pull/36032
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-11-19 10:54:53 +09:00
Daijiro Wachi 2351e2cffe test: integrate abort_controller tests from wpt
Refs: https://github.com/web-platform-tests/wpt/pull/9361

PR-URL: https://github.com/nodejs/node/pull/35869
Refs: https://github.com/web-platform-tests/wpt/blob/master/dom/abort/event.any.js
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-11-01 10:16:56 +09:00
Leko 4a6005c56a console: add Symbol.toStringTag property
Add Symbol.toStringTag property to console object to follow WPT changes
Update WPT status of console and the repl test case

Refs: https://github.com/web-platform-tests/wpt/pull/24717

PR-URL: https://github.com/nodejs/node/pull/35399
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-01 23:52:08 +08:00
Daijiro Wachi c88d845db3 test: update wpt status for url
PR-URL: https://github.com/nodejs/node/pull/35335
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-28 12:48:29 +09:00
Antoine du Hamel 7794d36a37 tools,doc: enforce alphabetical order for md refs
PR-URL: https://github.com/nodejs/node/pull/35244
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-09-22 10:25:43 -07:00
Michaël Zasso 4831278a16 url: remove U+0000 case in the fragment state
Port of https://github.com/whatwg/url/pull/486

PR-URL: https://github.com/nodejs/node/pull/33770
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-09-16 06:23:40 +00:00
Michaël Zasso eb9d7a437e test: update WPT harness and tests
PR-URL: https://github.com/nodejs/node/pull/33770
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-09-16 06:23:39 +00:00
Michaël Zasso 238104c531
test: move execution of WPT to worker threads
Running outside of the main Node.js context prevents us from upgrading
the WPT harness because new versions more aggressively check the
identity of globals like error constructors. Instead of exposing
globals used by the tests on vm sandboxes, use worker threads to run
everything.

PR-URL: https://github.com/nodejs/node/pull/34796
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-18 12:53:14 +02:00
Joyee Cheung d28198b498
test: update WPT interfaces and hr-time
This commit updates the interfaces to
https://github.com/web-platform-tests/wpt/tree/8ada332aea/interfaces
and updates the hr-time test status:

- `window-worker-timeOrigin.window.js` should be skipped because we
  don't implement `Blob`
- `idlharness.any.js` should be skipped since the IDL parser needs
  to be updated, but the parser update would also result in
  an update of the test harness which in turn requires updates of
  other tests. We need to fix the URL implementation first,
  and then update the harness and all the tests.

PR-URL: https://github.com/nodejs/node/pull/33297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-13 22:09:58 +08:00
Michaël Zasso c252f6c93f
test: add hr-time Web platform tests
Refs: https://github.com/nodejs/node/pull/32790

PR-URL: https://github.com/nodejs/node/pull/33287
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-05-10 13:54:34 +02:00
Anna Henningsen 237be2ed9e
encoding: make TextDecoder handle BOM correctly
Do not accept the BOM if it comes from a different encoding, and
only discard the BOM after it has actually been read (including
when it is spread over multiple chunks in streaming mode).

Fixes: https://github.com/nodejs/node/issues/25315

PR-URL: https://github.com/nodejs/node/pull/30132
Reviewed-By: Gus Caplan <me@gus.host>
2019-11-05 20:19:09 +01:00
Anna Henningsen f7b5eacaa6 test: remove unnecessary --expose-internals flags
PR-URL: https://github.com/nodejs/node/pull/29886
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-10 11:59:31 -07:00
Rich Trott a885630cbb doc: update list style in misc README docs
To confirm with upcoming markdown lint rule, use `*` for unordered
lists.

PR-URL: https://github.com/nodejs/node/pull/29594
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-09-17 21:30:42 -07:00
Anna Henningsen 7c9ee6dd88
util: add encodeInto to TextEncoder
Add function encodeInto to TextEncoder, and add MessageChannel
to the encodeInto.any.js test.

Fixes: https://github.com/nodejs/node/issues/28851
Fixes: https://github.com/nodejs/node/issues/26904
Refs: https://github.com/nodejs/node/pull/28862
Co-authored-by: AtticusYang <yyongtai@163.com>

PR-URL: https://github.com/nodejs/node/pull/29524
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-13 20:27:18 +02:00
Joyee Cheung 890223dede
src: expose DOMException to internalBinding('message') for testing
Instead of using a hack to get it in the test.

PR-URL: https://github.com/nodejs/node/pull/28072
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-09 19:51:30 +02:00
Joyee Cheung aa42d378b1 test: expect wpt/encoding/encodeInto.any.js to fail
Since we do not implement TextEncoder.prototype.encodeInto

PR-URL: https://github.com/nodejs/node/pull/27860
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-05-28 05:28:36 +02:00
Joyee Cheung 86ed4ada7f test: expect wpt/encoding/streams to fail
Since we do not implement TextDecoderStream or TextEncoderStream.

PR-URL: https://github.com/nodejs/node/pull/27860
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-05-28 05:28:04 +02:00
Rich Trott 556de23dfb test: remove unneeded `--expose-internals`
test/wpt/test-timers.js does not appear to need the `--expose-internals`
flag. Remove it.

PR-URL: https://github.com/nodejs/node/pull/27608
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-05-10 08:03:41 -07:00
Anna Henningsen b0de48e854
src,lib: make DOMException available in all Contexts
This allows using `DOMException` from Node.js code for any
`vm.Context`.

PR-URL: https://github.com/nodejs/node/pull/26497
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-15 16:54:19 +01:00
Joyee Cheung d9066bef2c
test: run html/webappapis/timers WPT
PR-URL: https://github.com/nodejs/node/pull/25618
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-01 00:52:00 +08:00
Joyee Cheung 47aa17274a
test: run html/webappapis/microtask-queuing WPT
PR-URL: https://github.com/nodejs/node/pull/25616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2019-01-25 00:12:12 +08:00
Joyee Cheung 16dfa0f309
test: use WPT runner to run encoding tests
PR-URL: https://github.com/nodejs/node/pull/25321
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10 19:54:58 +08:00
Joyee Cheung c667325cbe
test: support more icu requirements in the WPT status file
Support `small-icu` and `full-icu` requirements, where `full-icu`
implies `small-icu`.

PR-URL: https://github.com/nodejs/node/pull/25321
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10 19:54:57 +08:00
Joyee Cheung 8906e5209b
test: pull enconding WPT test fixtures
PR-URL: https://github.com/nodejs/node/pull/25321
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10 19:54:55 +08:00
Anna Henningsen 63d4cae009
worker: remove `--experimental-worker` flag
Having an experimental feature behind a flag makes change
if we are expecting significant breaking changes to its API.

Since the Worker API has been essentially stable since
its initial introduction, and no noticeable doubt about
possibly not keeping the feature around has been voiced,
removing the flag and thereby reducing the barrier to experimentation,
and consequently receiving feedback on the implementation,
seems like a good idea.

PR-URL: https://github.com/nodejs/node/pull/25361
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-09 00:31:33 +01:00
Joyee Cheung a96ba1c8b6 test: remove reference to whatwg in file names under test/wpt
WPT covers standards in both W3C and WHATWG, as such it would be
strange to make this disparity explicit in our file names
(e.g. when testing standards that are solely in W3C, like
performance-timeline). Remove the reference to WHATWG will
also make the file names shorter.

PR-URL: https://github.com/nodejs/node/pull/24826
Refs: https://github.com/nodejs/node/issues/24823
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-12-14 18:04:43 -08:00
Joyee Cheung 2742f3869a test: use Worker scope in WPT
Previously, we use the Window scope by default in our WPT test
runner. When one of the test fails, the WPT harness would try to
use document.getElementsByTagName() etc. to display the failure,
which is not going to work for us.

This patch switches the scope to DedicatedWorker and use our
Worker implementation as a global - this does not test the Worker
implementation per se, just tells the WPT harness to pass the results
back to us via the callbacks we installed and not try to access
a document.

We may still need to use a Window scope when we try to run
.window.js tests in the future, but for now we only run .any.js
tests so it's fine to use a worker scope by default.

PR-URL: https://github.com/nodejs/node/pull/24410
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-11-20 15:27:38 -08:00
Joyee Cheung 9858e331e3
test: initialize test/wpt to run URL and console .js tests
This patch:

- Creates a new test suite `wpt` that can be used to run a subset
  of Web Platform Tests
- Adds a `WPTRunner` in `test/common/wpt.js` that can run the WPT
  subset in `test/fixtures/wpt` with a vm and the WPT harness
  while taking the status file in `test/wpt/status` into account.
  Here we use a new format of status file (in JSON) to handle specific
  requirements (like ICU requirements) in the tests and to handle
  expected failures and TODOs.
- Adds documentation on how the runner and the update automation works
- Runs the WHATWG URL tests and the console tests with the new test
  runner.

With this patch we eliminates the need of copy-pasting with manual
modifications to update a large chunk of our WPT subset previously
maintained in `test/parallel`. Now the tests run in `test/wpt` can
be automatically updated with `git node wpt` without modifications
by the actual WPT harness instead of our home-grown mock.

There are still a few URL tests left that need to be migrated in the
upstream to be placed in .js instead of .html - we currently still use
the legacy harness mock in the test files.

PR-URL: https://github.com/nodejs/node/pull/24035
Refs: https://github.com/nodejs/node/issues/23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 20:27:21 +08:00