Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v12.18.1 proposal #33811

Merged
merged 88 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
194789f
stream: make all streams error in a pipeline
mcollina Dec 9, 2019
edf75e4
src: use basename(argv0) for --trace-uncaught suggestion
addaleax Apr 12, 2020
1766514
test: add tests for options.fs in fs streams
julianduque May 1, 2020
e572cf9
doc: fix style and grammer in buffer.md
seishun May 1, 2020
c6cf048
doc: explicitly doc package.exports is breaking
MylesBorins Apr 26, 2020
b43fc64
Revert "src: add aliased-buffer-overflow abort test"
richardlau May 1, 2020
c054834
Revert "src: add test/abort build tasks"
richardlau May 1, 2020
ea3a68f
doc: doc and test URLSearchParams discrepancy
jasnell May 4, 2020
033bc96
doc: update napi_async_init documentation
mhdawson Apr 30, 2020
4294d92
stream: make from read one at a time
ronag May 1, 2020
82da74b
n-api: add uint32 test for -1
May 5, 2020
ac5cdd6
doc: add warnings about transferring Buffers and ArrayBuffer
jasnell May 5, 2020
2262962
doc: remove AsyncWrap mentions from async_hooks.md
puzpuzpuz May 5, 2020
ad7a890
doc: add troubleshooting guide for AsyncLocalStorage
puzpuzpuz May 5, 2020
33aacbe
wasi: prevent syscalls before start
tniessen May 4, 2020
4a58420
doc: specify unit of time passed to `fs.utimes`
SimenB May 4, 2020
8b44be9
doc: add Uint8Array to `end` and `write`
rexagod May 2, 2020
9038620
doc: update Buffer(size) documentation
seishun May 1, 2020
0cee4c3
doc: removed unnecessary util imports from vm examples
WalasPrime Apr 30, 2020
59619b0
doc: mention python3-distutils dependency in BUILDING.md
osher Apr 30, 2020
9017bce
lib: fix grammar in internal/bootstrap/loaders.js
szTheory May 2, 2020
139eb6b
test: skip some console tests on dumb terminal
AdamMajer Apr 30, 2020
0177cbf
test: rename test-lookupService-promises
rickyes Apr 27, 2020
0c7cf24
doc: correct description of `decipher.setAuthTag` in crypto.md
jbuhacoff Apr 27, 2020
ed62d43
src: clean up large pages code
May 5, 2020
22f2c2c
wasi: fix poll_oneoff memory interface
cjihrig May 5, 2020
9dde1db
doc: add warning for socket.connect reuse
ronag May 5, 2020
77caf92
module: better error for named exports from cjs
MylesBorins May 5, 2020
a5e8c5c
src: split out callback queue implementation from Environment
addaleax May 6, 2020
6881410
lib: refactored scheduling policy assignment
yashLadha Apr 5, 2020
d64dbfa
meta: add issue template for API reference docs
DerekNonGeneric Apr 20, 2020
642f813
src: fix invalid windowBits=8 gzip segfault
bnoordhuis Apr 24, 2020
631e433
zlib: reject windowBits=8 when mode=GZIP
bnoordhuis Apr 24, 2020
66dbaff
http2: add `bytesWritten` test for `Http2Stream`
rexagod Apr 21, 2020
964adfa
buffer: improve copy() performance
seishun May 2, 2020
4d6f56a
deps: upgrade npm to 6.14.5
ruyadorno May 4, 2020
68551d2
perf_hooks: fix error message for invalid entryTypes
targos May 7, 2020
cd92052
test: add hr-time Web platform tests
targos May 7, 2020
5d5e66c
tools: add eslint rule to only pass through 'test' to debuglog
BridgeAR Mar 9, 2020
cdd7d3a
tools: remove obsolete no-restricted-syntax eslint rules
BridgeAR Mar 9, 2020
b630079
src: remove unnecessary Isolate::GetCurrent() calls
addaleax May 8, 2020
59769c4
lib: fix typo in timers insert function comment
danbev May 8, 2020
2645b1c
tools: update ESLint to 7.0.0
cjihrig May 8, 2020
c459832
test: fix test-net-throttle
Trott May 9, 2020
f27ae6e
src: fix typo in comment in async_wrap.cc
danbev May 11, 2020
30c9cb5
doc: fix typo in n-api.md
danbev May 9, 2020
318fcf8
doc: add note about clientError writable handling
ShogunPanda May 8, 2020
548672d
src: use MaybeLocal.ToLocal instead of IsEmpty
danbev May 8, 2020
82c43d1
src: delete unused variables to resolve compile time print warning
rickyes May 11, 2020
fe780a5
src: remove unused using declarations in node.cc
danbev May 6, 2020
1f159e4
src: add primordials to arguments comment
danbev May 9, 2020
fa16313
test: update WPT interfaces and hr-time
joyeecheung May 12, 2020
33a7878
test: refactor WPTRunner
joyeecheung May 6, 2020
7315c22
tls: fix --tls-keylog option
mildsunrise May 12, 2020
3d8ba29
doc: add examples for implementing ESM
rosaxxny Apr 30, 2020
9f594be
test: fix test-dns-idna2008
Trott May 12, 2020
d2897a2
doc: enhance guides by fixing and making grammar more consistent
ChrisAHolland Apr 29, 2020
aa4611c
fs: clean up Dir.read() uv_fs_t data before calling into JS
addaleax May 6, 2020
c129e88
fs: forbid concurrent operations on Dir handle
addaleax May 7, 2020
8a92698
worker: call CancelTerminateExecution() before exiting Locker
addaleax May 10, 2020
ba93c8d
async_hooks: clear async_id_stack for terminations in more places
addaleax May 11, 2020
5da7d52
test: regression tests for async_hooks + Promise + Worker interaction
addaleax May 10, 2020
a0bc2e3
src: replace to CHECK_NOT_NULL in node_crypto
himself65 May 13, 2020
4f6e4ae
module: add specific error for dir import
aduh95 May 3, 2020
a029dca
esm: improve commonjs hint on module not found
aduh95 May 14, 2020
29d24db
src: add #include <string> in json_utils.h
zcbenz May 10, 2020
b4d9034
worker: fix crash when .unref() is called during exit
addaleax May 14, 2020
b924910
src: distinguish refed/unrefed threadsafe Immediates
addaleax May 9, 2020
a9ed287
doc: fix extension in esm example
devsnek May 14, 2020
e240d56
tools: update dependencies for markdown linting
Trott May 15, 2020
5d80576
errors: skip fatal error highlighting on windows
Hakerh400 Apr 28, 2020
9883ba6
src: add promise_resolve to SetupHooks comment
danbev May 12, 2020
e668376
src: remove unused misc variable
danbev May 15, 2020
548db2e
src: remove unused IsolateSettings variable
danbev May 15, 2020
a48aeb3
doc: clarify about the Node.js-only extensions in perf_hooks
joyeecheung May 1, 2020
402aa1b
deps: upgrade to libuv 1.38.0
cjihrig May 17, 2020
4749156
doc: add comment about highWaterMark limit
benjamingr May 16, 2020
0c9b826
doc: update function description for `decipher.setAAD`
jbuhacoff Apr 27, 2020
c797c7c
src: reduce duplication in RegisterHandleCleanups
danbev May 15, 2020
5eed20b
worker: fix race condition in node_messaging.cc
addaleax May 16, 2020
fa4a37c
http2: comment on usage of `Object.create(null)`
rexagod Apr 25, 2020
7d8a226
doc: fix typos in handle scope descriptions
tniessen May 6, 2020
9572701
doc: add fs.open() multiple constants example
Ethan-Arrowood May 7, 2020
98a7026
doc: document module.path
aduh95 May 9, 2020
e67df04
src: use BaseObjectPtr in StreamReq::Dispose
jasnell Apr 27, 2020
5c7176b
deps: update to uvwasi 0.0.9
cjihrig May 4, 2020
af95bd7
deps: V8: cherry-pick 548f6c81d424
dominykas May 20, 2020
6665f73
2020-06-17, Version 12.18.1 'Erbium' (LTS)
codebytere Jun 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add hr-time Web platform tests
Refs: #32790

PR-URL: #33287
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
targos authored and codebytere committed Jun 7, 2020
commit cd92052935e19a9e684f12c5ec49dd9441d8fe5e
1 change: 1 addition & 0 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Last update:
- interfaces: https://github.com/web-platform-tests/wpt/tree/712c9f275e/interfaces
- html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/0c3bed38df/html/webappapis/microtask-queuing
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/ddfe9c089b/html/webappapis/timers
- hr-time: https://github.com/web-platform-tests/wpt/tree/a5d1774ecf/hr-time

[Web Platform Tests]: https://github.com/web-platform-tests/wpt
[`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt
4 changes: 4 additions & 0 deletions test/fixtures/wpt/hr-time/META.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
spec: https://w3c.github.io/hr-time/
suggested_reviewers:
- plehegar
- igrigorik
28 changes: 28 additions & 0 deletions test/fixtures/wpt/hr-time/basic.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test(function() {
assert_true((self.performance !== undefined), "self.performance exists");
assert_equals(typeof self.performance, "object", "self.performance is an object");
assert_equals((typeof self.performance.now), "function", "self.performance.now() is a function");
assert_equals(typeof self.performance.now(), "number", "self.performance.now() returns a number");
}, "self.performance.now() is a function that returns a number");

test(function() {
assert_true(self.performance.now() > 0);
}, "self.performance.now() returns a positive number");

test(function() {
var now1 = self.performance.now();
var now2 = self.performance.now();
assert_true((now2-now1) >= 0);
}, "self.performance.now() difference is not negative");

async_test(function() {
// Check whether the performance.now() method is close to Date() within 30ms (due to inaccuracies)
var initial_hrt = self.performance.now();
var initial_date = Date.now();
this.step_timeout(function() {
var final_hrt = self.performance.now();
var final_date = Date.now();
assert_approx_equals(final_hrt - initial_hrt, final_date - initial_date, 30, 'High resolution time value increased by approximately the same amount as time from date object');
this.done();
}, 2000);
}, 'High resolution time has approximately the right relative magnitude');
23 changes: 23 additions & 0 deletions test/fixtures/wpt/hr-time/idlharness.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: timeout=long

'use strict';

// https://w3c.github.io/hr-time/

idl_test(
['hr-time'],
['html', 'dom'],
async idl_array => {
if (self.GLOBAL.isWorker()) {
idl_array.add_objects({ WorkerGlobalScope: ['self'] });
} else {
idl_array.add_objects({ Window: ['self'] });
}
idl_array.add_objects({
Performance: ['performance'],
});
}
);
13 changes: 13 additions & 0 deletions test/fixtures/wpt/hr-time/monotonic-clock.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// The time values returned when calling the now method MUST be monotonically increasing and not subject to system clock adjustments or system clock skew.
test(function() {
assert_true(self.performance.now() > 0, "self.performance.now() returns positive numbers");
}, "self.performance.now() returns a positive number");

// The difference between any two chronologically recorded time values returned from the now method MUST never be negative.
test(function() {
var now1 = self.performance.now();
var now2 = self.performance.now();
assert_true((now2-now1) >= 0, "self.performance.now() difference is not negative");
},
"self.performance.now() difference is not negative"
);
76 changes: 76 additions & 0 deletions test/fixtures/wpt/hr-time/performance-tojson.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!doctype html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>

test(() => {
// Check Performance attributes.
assert_equals(typeof(performance.toJSON), 'function');
const json = performance.toJSON();
assert_equals(typeof(json), 'object');
assert_equals(json.timeOrigin, performance.timeOrigin,
'performance.toJSON().timeOrigin should match performance.timeOrigin');

// Check PerformanceTiming toJSON.
const jsonTiming = json.timing;
const timing = performance.timing;
assert_equals(typeof(timing.toJSON), 'function');
const timingJSON = timing.toJSON();
assert_equals(typeof(timingJSON), 'object');
// Check PerformanceTiming attributes, from both:
// 1) |jsonTiming| from Performance.
// 2) |timingJSON| from PerformanceTiming.
const performanceTimingKeys = [
'navigationStart',
'unloadEventStart',
'unloadEventEnd',
'redirectStart',
'redirectEnd',
'fetchStart',
'domainLookupStart',
'domainLookupEnd',
'connectStart',
'connectEnd',
'secureConnectionStart',
'requestStart',
'responseStart',
'responseEnd',
'domLoading',
'domInteractive',
'domContentLoadedEventStart',
'domContentLoadedEventEnd',
'domComplete',
'loadEventStart',
'loadEventEnd'
];
for (const key of performanceTimingKeys) {
assert_equals(jsonTiming[key], timing[key],
`performance.toJSON().timing.${key} should match performance.timing.${key}`);
assert_equals(timingJSON[key], timing[key],
`performance.timing.toJSON().${key} should match performance.timing.${key}`);
}

// Check PerformanceNavigation toJSON.
const jsonNavigation = json.navigation;
const navigation = performance.navigation;
assert_equals(typeof(navigation.toJSON), 'function');
const navigationJSON = navigation.toJSON();
assert_equals(typeof(navigationJSON), 'object');
// Check PerformanceNavigation attributes, from both:
// 1) |jsonNavigation| from Performance.
// 2) |navigationJSON| from PerformanceNavigation.
let performanceNavigationKeys = ['type', 'redirectCount'];
for (const key of performanceNavigationKeys) {
assert_equals(jsonNavigation[key], navigation[key],
`performance.toJSON().navigation.${key} should match performance.navigation.${key}`);
assert_equals(navigationJSON[key], navigation[key],
`performance.navigation.toJSON().${key} should match performance.navigation.${key}`);
}
}, 'Test performance.toJSON()');
</script>
</body>
</html>
9 changes: 9 additions & 0 deletions test/fixtures/wpt/hr-time/resources/now_frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>window.performance.now frame</title>
<link rel="author" title="Google" href="http://www.google.com/" />
</head>
<body></body>
</html>
13 changes: 13 additions & 0 deletions test/fixtures/wpt/hr-time/resources/unload-a.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Helper page for ../unload-manual.html</title>
</head>
<body>
<script src="./unload.js"></script>
<script>
setupListeners("a", "./unload-b.html");
</script>
<button id="proceed">Click me!</button>
</body>
</html>
13 changes: 13 additions & 0 deletions test/fixtures/wpt/hr-time/resources/unload-b.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Helper page for ../unload-manual.html</title>
</head>
<body>
<script src="./unload.js"></script>
<script>
setupListeners("b", "./unload-c.html");
</script>
<button id="proceed">Click me again!</button>
</body>
</html>
13 changes: 13 additions & 0 deletions test/fixtures/wpt/hr-time/resources/unload-c.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Helper page for ../unload-manual.html</title>
</head>
<body>
<script src="./unload.js"></script>
<script>
setupListeners("c", null);
</script>
<button id="proceed">Click me, one last time!</button>
</body>
</html>
50 changes: 50 additions & 0 deletions test/fixtures/wpt/hr-time/resources/unload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const syncDelay = ms => {
const start = performance.now();
let elapsedTime;
do {
elapsedTime = performance.now() - start;
} while (elapsedTime < ms);
};

const markTime = (docName, lifecycleEventName) => {
// Calculating these values before the below `mark` invocation ensures that delays in
// reaching across to the other window object doesn't interfere with the correctness
// of the test.
const dateNow = Date.now();
const performanceNow = performance.now();

window.opener.mark({
docName,
lifecycleEventName,
performanceNow: performanceNow,
dateNow: dateNow
});
};

const setupUnloadPrompt = (docName, msg) => {
window.addEventListener("beforeunload", ev => {
markTime(docName, "beforeunload");
return ev.returnValue = msg || "Click OK to continue test."
});
};

const setupListeners = (docName, nextDocument) => {
window.addEventListener("load", () => {
markTime(docName, "load");
document.getElementById("proceed").addEventListener("click", ev => {
ev.preventDefault();
if (nextDocument) {
document.location = nextDocument;
} else {
window.close();
}
})
});

setupUnloadPrompt(docName);

window.addEventListener("unload", () => {
markTime(docName, "unload");
if (docName !== "c") { syncDelay(1000); }
});
};
59 changes: 59 additions & 0 deletions test/fixtures/wpt/hr-time/test_cross_frame_start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<title>window.performance.now across frames</title>
<link rel="author" title="Google" href="http://www.google.com/">
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script type="text/javascript">
setup({explicit_done: true});

var setup_frame = async_test("Setup the frame");

function start_test() {
setup_frame.step_timeout(function () {
var iframe = document.createElement('iframe');
iframe.id = 'frameContext';
iframe.onload = finish_test;
iframe.src = "resources/now_frame.html";
document.body.appendChild(iframe);
setup_frame.done();
}, 1000);
}

function finish_test() {
var childWindow = document.getElementById('frameContext').contentWindow;

// Verify a positive number is returned for both the frame and parent.
test(function() { assert_true(window.performance.now() > 0); }, 'parent performance.now() > 0');
test(function() { assert_true(childWindow.performance.now() > 0); }, 'child performance.now() > 0');

// Verify that the test properly created the child at least a second after the parent.
test(function () { assert_true(childWindow.performance.timing.navigationStart > (window.performance.timing.navigationStart + 1000)); },
'Child created at least 1 second after parent');

test(function () {
var parentNow = window.performance.now();
var childNow = childWindow.performance.now();
var childParentSkew = Math.abs(childNow - parentNow);
assert_true(childParentSkew > 1000, 'Child and parent\'s now()s have different bases (skewed more than 1 second)');

var childLoadTime = childWindow.performance.timing.loadEventStart - childWindow.performance.timing.navigationStart;
assert_true(1000 > (childNow - childLoadTime), 'Child\'s now() is based on its document\'s navigationStart');
}, 'Child and parent time bases are correct');

done();
}
</script>

</head>
<body onload="start_test()">
<h1>Description</h1>
<p>This test validates the values of the window.performance.now() are based on the current document's navigationStart.</p>
<div id="log"></div>
</body>
</html>
45 changes: 45 additions & 0 deletions test/fixtures/wpt/hr-time/timeOrigin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
const windowOrigin = performance.timeOrigin;

test(() => {
// Use a 30ms cushion when comparing with Date() to account for inaccuracy.
const startTime = Date.now();
assert_greater_than_equal(startTime + 30, windowOrigin, 'Date.now() should be at least as large as the window timeOrigin.');
const startNow = performance.now();
assert_less_than_equal(startTime, windowOrigin + startNow + 30, 'Date.now() should be close to window timeOrigin.');
}, 'Window timeOrigin is close to Date.now() when there is no system clock adjustment.');

const workerScript = 'postMessage({timeOrigin: performance.timeOrigin})';
const blob = new Blob([workerScript]);

async_test(function(t) {
const beforeWorkerCreation = performance.now();
const worker = new Worker(URL.createObjectURL(blob));
worker.addEventListener('message', t.step_func_done(function(event) {
const workerOrigin = event.data.timeOrigin;
assert_greater_than_equal(workerOrigin, windowOrigin + beforeWorkerCreation, 'Worker timeOrigin should be greater than the window timeOrigin.');
const afterWorkerCreation = performance.now();
assert_less_than_equal(workerOrigin - windowOrigin, afterWorkerCreation, 'Window and worker timeOrigins should be close.');
}));
}, 'Window and worker timeOrigins are close when created one after another.');

async_test(function(t) {
this.step_timeout(function() {
const workerCreation = performance.now();
const worker = new Worker(URL.createObjectURL(blob));
worker.addEventListener('message', t.step_func_done(function(event) {
const workerOrigin = event.data.timeOrigin;
assert_greater_than_equal(workerOrigin - windowOrigin, 200, 'We waited 200ms to spawn the second worker, so its timeOrigin should be greater than that of the window.');
}));
}, 200);
}, 'Window and worker timeOrigins differ when worker is created after a delay.');
</script>
</body>
</html>
Loading