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

[streams] Refactor to multi-global test format #14172

Merged
merged 9 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions lint.whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,6 @@ SET TIMEOUT: shadow-dom/Document-prototype-currentScript.html
SET TIMEOUT: shadow-dom/scroll-to-the-fragment-in-shadow-tree.html
SET TIMEOUT: shadow-dom/slotchange-event.html
SET TIMEOUT: shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html
SET TIMEOUT: streams/piping/close-propagation-forward.js
SET TIMEOUT: streams/piping/error-propagation-backward.js
SET TIMEOUT: streams/piping/error-propagation-forward.js
SET TIMEOUT: streams/piping/general.js
SET TIMEOUT: streams/readable-streams/cancel.js
SET TIMEOUT: streams/resources/rs-utils.js
SET TIMEOUT: streams/writable-streams/byte-length-queuing-strategy.js
SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: user-timing/*
Expand Down
11 changes: 0 additions & 11 deletions streams/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Streams Tests

The work on the streams tests is closely tracked by the specification authors, who maintain a reference implementation intended to match the spec line-by-line while passing all of these tests. See [the whatwg/streams repository for details](https://github.com/whatwg/streams/tree/master/reference-implementation). Some tests may be in that repository while the spec sections they test are still undergoing heavy churn.

## Generating wrapper files

Because the streams feature is supposed to work in all global contexts, each test is written as a `.js` file, and then four `.html` files are generated around it. So for example, for `count-queueing-strategy.js`, we have the wrapper files:

- `count-queueing-strategy.https.html`
- `count-queueing-strategy.dedicatedworker.html`
- `count-queueing-strategy-sharedworker.html`
- `count-queueing-strategy-serviceworker.html`

These are generated automatically by the Node.js script in `generate-test-wrappers.js`. See it for details, and please remember to use it whenever adding new tests.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// META: global=worker
'use strict';

if (self.importScripts) {
self.importScripts('/resources/testharness.js');
}

test(() => {

new ByteLengthQueuingStrategy({ highWaterMark: 4 });
Expand Down Expand Up @@ -110,5 +107,3 @@ test(() => {
'ByteLengthQueuingStrategy.name must be "ByteLengthQueuingStrategy"');

}, 'ByteLengthQueuingStrategy.name is correct');

done();
11 changes: 0 additions & 11 deletions streams/byte-length-queuing-strategy.dedicatedworker.html

This file was deleted.

10 changes: 0 additions & 10 deletions streams/byte-length-queuing-strategy.html

This file was deleted.

12 changes: 0 additions & 12 deletions streams/byte-length-queuing-strategy.serviceworker.https.html

This file was deleted.

11 changes: 0 additions & 11 deletions streams/byte-length-queuing-strategy.sharedworker.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// META: global=worker
'use strict';

if (self.importScripts) {
self.importScripts('/resources/testharness.js');
}

test(() => {

new CountQueuingStrategy({ highWaterMark: 4 });
Expand Down Expand Up @@ -109,5 +106,3 @@ test(() => {
'CountQueuingStrategy.name must be "CountQueuingStrategy"');

}, 'CountQueuingStrategy.name is correct');

done();
11 changes: 0 additions & 11 deletions streams/count-queuing-strategy.dedicatedworker.html

This file was deleted.

10 changes: 0 additions & 10 deletions streams/count-queuing-strategy.html

This file was deleted.

12 changes: 0 additions & 12 deletions streams/count-queuing-strategy.serviceworker.https.html

This file was deleted.

11 changes: 0 additions & 11 deletions streams/count-queuing-strategy.sharedworker.html

This file was deleted.

99 changes: 0 additions & 99 deletions streams/generate-test-wrappers.js

This file was deleted.

11 changes: 3 additions & 8 deletions streams/piping/abort.js → streams/piping/abort.any.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// META: global=worker
// META: script=../resources/recording-streams.js
// META: script=../resources/test-utils.js
'use strict';

// Tests for the use of pipeTo with AbortSignal.
// There is some extra complexity to avoid timeouts in environments where abort is not implemented.

if (self.importScripts) {
self.importScripts('/resources/testharness.js');
self.importScripts('../resources/recording-streams.js');
self.importScripts('../resources/test-utils.js');
}

const error1 = new Error('error1');
error1.name = 'error1';
const error2 = new Error('error2');
Expand Down Expand Up @@ -361,5 +358,3 @@ promise_test(t => {
assert_array_equals(rs.events, ['pull'], 'cancel should not have been called');
});
}, 'abort should do nothing after the writable is errored');

done();
11 changes: 0 additions & 11 deletions streams/piping/abort.dedicatedworker.html

This file was deleted.

11 changes: 0 additions & 11 deletions streams/piping/abort.html

This file was deleted.

12 changes: 0 additions & 12 deletions streams/piping/abort.serviceworker.https.html

This file was deleted.

11 changes: 0 additions & 11 deletions streams/piping/abort.sharedworker.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// META: global=worker
// META: script=../resources/recording-streams.js
'use strict';

if (self.importScripts) {
self.importScripts('/resources/testharness.js');
self.importScripts('../resources/recording-streams.js');
}

const error1 = new Error('error1!');
error1.name = 'error1';

Expand Down Expand Up @@ -154,5 +151,3 @@ promise_test(t => {

}, 'Closing must be propagated backward: starts closed; preventCancel = true, preventAbort = true, preventClose ' +
'= true');

done();
11 changes: 0 additions & 11 deletions streams/piping/close-propagation-backward.dedicatedworker.html

This file was deleted.

10 changes: 0 additions & 10 deletions streams/piping/close-propagation-backward.html

This file was deleted.

12 changes: 0 additions & 12 deletions streams/piping/close-propagation-backward.serviceworker.https.html

This file was deleted.

11 changes: 0 additions & 11 deletions streams/piping/close-propagation-backward.sharedworker.html

This file was deleted.

Loading