Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js

Issue 2642393002: Import wpt@40665266227e475bc4a56884247d8c09d78dfb6a (Closed)
Patch Set: rebaseline-cl Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js b/third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js
index e36463ba7cf0a5d14fb467b8af22b24b83aaf8a6..ef68e0ade647baf5ddf002615e4e4efdb5dbae02 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/streams/resources/rs-test-templates.js
@@ -18,7 +18,7 @@ self.templatedRSEmpty = (label, factory) => {
assert_equals(typeof rs.pipeTo, 'function', 'has a pipeTo method');
assert_equals(typeof rs.tee, 'function', 'has a tee method');
- }, 'instances have the correct methods and properties');
+ }, label + ': instances have the correct methods and properties');
test(() => {
const rs = factory();
@@ -28,7 +28,7 @@ self.templatedRSEmpty = (label, factory) => {
assert_throws(new RangeError(), () => rs.getReader({ mode: 'asdf' }), 'asdf mode should throw');
assert_throws(new TypeError(), () => rs.getReader(null), 'null should throw');
- }, 'calling getReader with invalid arguments should throw appropriate errors');
+ }, label + ': calling getReader with invalid arguments should throw appropriate errors');
};
self.templatedRSClosed = (label, factory) => {
@@ -47,21 +47,21 @@ self.templatedRSClosed = (label, factory) => {
cancelPromise2.then(v => assert_equals(v, undefined, 'second cancel() call should fulfill with undefined'))
]);
- }, 'cancel() should return a distinct fulfilled promise each time');
+ }, label + ': cancel() should return a distinct fulfilled promise each time');
test(() => {
const rs = factory();
assert_false(rs.locked, 'locked getter should return false');
- }, 'locked should be false');
+ }, label + ': locked should be false');
test(() => {
const rs = factory();
rs.getReader(); // getReader() should not throw.
- }, 'getReader() should be OK');
+ }, label + ': getReader() should be OK');
test(() => {
@@ -75,7 +75,7 @@ self.templatedRSClosed = (label, factory) => {
rs.getReader(); // Getting a third reader should not throw.
- }, 'should be able to acquire multiple readers if they are released in succession');
+ }, label + ': should be able to acquire multiple readers if they are released in succession');
test(() => {
@@ -86,7 +86,7 @@ self.templatedRSClosed = (label, factory) => {
assert_throws(new TypeError(), () => rs.getReader(), 'getting a second reader should throw');
assert_throws(new TypeError(), () => rs.getReader(), 'getting a third reader should throw');
- }, 'should not be able to acquire a second reader if we don\'t release the first one');
+ }, label + ': should not be able to acquire a second reader if we don\'t release the first one');
};
self.templatedRSErrored = (label, factory, error) => {
@@ -102,7 +102,7 @@ self.templatedRSErrored = (label, factory, error) => {
promise_rejects(t, error, reader.read())
]);
- }, 'getReader() should return a reader that acts errored');
+ }, label + ': getReader() should return a reader that acts errored');
promise_test(t => {
@@ -115,13 +115,13 @@ self.templatedRSErrored = (label, factory, error) => {
promise_rejects(t, error, reader.closed)
]);
- }, 'read() twice should give the error each time');
+ }, label + ': read() twice should give the error each time');
test(() => {
const rs = factory();
assert_false(rs.locked, 'locked getter should return false');
- }, 'locked should be false');
+ }, label + ': locked should be false');
};
self.templatedRSErroredSyncOnly = (label, factory, error) => {
@@ -135,7 +135,7 @@ self.templatedRSErroredSyncOnly = (label, factory, error) => {
return promise_rejects(t, error, reader.closed);
- }, 'should be able to obtain a second reader, with the correct closed promise');
+ }, label + ': should be able to obtain a second reader, with the correct closed promise');
test(() => {
@@ -145,7 +145,7 @@ self.templatedRSErroredSyncOnly = (label, factory, error) => {
assert_throws(new TypeError(), () => rs.getReader(), 'getting a second reader should throw a TypeError');
assert_throws(new TypeError(), () => rs.getReader(), 'getting a third reader should throw a TypeError');
- }, 'should not be able to obtain additional readers if we don\'t release the first lock');
+ }, label + ': should not be able to obtain additional readers if we don\'t release the first lock');
promise_test(t => {
@@ -160,7 +160,7 @@ self.templatedRSErroredSyncOnly = (label, factory, error) => {
promise_rejects(t, error, cancelPromise2)
]);
- }, 'cancel() should return a distinct rejected promise each time');
+ }, label + ': cancel() should return a distinct rejected promise each time');
promise_test(t => {
@@ -176,7 +176,7 @@ self.templatedRSErroredSyncOnly = (label, factory, error) => {
promise_rejects(t, error, cancelPromise2)
]);
- }, 'reader cancel() should return a distinct rejected promise each time');
+ }, label + ': reader cancel() should return a distinct rejected promise each time');
};
self.templatedRSEmptyReader = (label, factory) => {
@@ -193,7 +193,7 @@ self.templatedRSEmptyReader = (label, factory) => {
assert_equals(typeof reader.read, 'function', 'has a read method');
assert_equals(typeof reader.releaseLock, 'function', 'has a releaseLock method');
- }, 'instances have the correct methods and properties');
+ }, label + ': instances have the correct methods and properties');
test(() => {
@@ -201,7 +201,7 @@ self.templatedRSEmptyReader = (label, factory) => {
assert_true(stream.locked, 'locked getter should return true');
- }, 'locked should be true');
+ }, label + ': locked should be true');
promise_test(t => {
@@ -214,7 +214,7 @@ self.templatedRSEmptyReader = (label, factory) => {
return delay(500);
- }, 'read() should never settle');
+ }, label + ': read() should never settle');
promise_test(t => {
@@ -232,21 +232,21 @@ self.templatedRSEmptyReader = (label, factory) => {
return delay(500);
- }, 'two read()s should both never settle');
+ }, label + ': two read()s should both never settle');
test(() => {
const reader = factory().reader;
assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');
- }, 'read() should return distinct promises each time');
+ }, label + ': read() should return distinct promises each time');
test(() => {
const stream = factory().stream;
assert_throws(new TypeError(), () => stream.getReader(), 'stream.getReader() should throw a TypeError');
- }, 'getReader() again on the stream should fail');
+ }, label + ': getReader() again on the stream should fail');
promise_test(t => {
@@ -275,7 +275,7 @@ self.templatedRSEmptyReader = (label, factory) => {
return delay(500);
- }, 'releasing the lock with pending read requests should throw but the read requests should stay pending');
+ }, label + ': releasing the lock with pending read requests should throw but the read requests should stay pending');
promise_test(t => {
@@ -287,7 +287,7 @@ self.templatedRSEmptyReader = (label, factory) => {
promise_rejects(t, new TypeError(), reader.read())
]);
- }, 'releasing the lock should cause further read() calls to reject with a TypeError');
+ }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');
promise_test(t => {
@@ -301,7 +301,7 @@ self.templatedRSEmptyReader = (label, factory) => {
return promise_rejects(t, new TypeError(), closedBefore);
- }, 'releasing the lock should cause closed calls to reject with a TypeError');
+ }, label + ': releasing the lock should cause closed calls to reject with a TypeError');
test(() => {
@@ -312,7 +312,7 @@ self.templatedRSEmptyReader = (label, factory) => {
reader.releaseLock();
assert_false(stream.locked, 'locked getter should return false');
- }, 'releasing the lock should cause locked to become false');
+ }, label + ': releasing the lock should cause locked to become false');
promise_test(() => {
@@ -323,14 +323,14 @@ self.templatedRSEmptyReader = (label, factory) => {
assert_object_equals(r, { value: undefined, done: true }, 'read()ing from the reader should give a done result');
});
- }, 'canceling via the reader should cause the reader to act closed');
+ }, label + ': canceling via the reader should cause the reader to act closed');
promise_test(t => {
const stream = factory().stream;
return promise_rejects(t, new TypeError(), stream.cancel());
- }, 'canceling via the stream should fail');
+ }, label + ': canceling via the stream should fail');
};
self.templatedRSClosedReader = (label, factory) => {
@@ -344,7 +344,7 @@ self.templatedRSClosedReader = (label, factory) => {
assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
});
- }, 'read() should fulfill with { value: undefined, done: true }');
+ }, label + ': read() should fulfill with { value: undefined, done: true }');
promise_test(() => {
@@ -359,7 +359,7 @@ self.templatedRSClosedReader = (label, factory) => {
})
]);
- }, 'read() multiple times should fulfill with { value: undefined, done: true }');
+ }, label + ': read() multiple times should fulfill with { value: undefined, done: true }');
promise_test(() => {
@@ -369,7 +369,7 @@ self.templatedRSClosedReader = (label, factory) => {
assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
});
- }, 'read() should work when used within another read() fulfill callback');
+ }, label + ': read() should work when used within another read() fulfill callback');
promise_test(() => {
@@ -377,7 +377,7 @@ self.templatedRSClosedReader = (label, factory) => {
return reader.closed.then(v => assert_equals(v, undefined, 'reader closed should fulfill with undefined'));
- }, 'closed should fulfill with undefined');
+ }, label + ': closed should fulfill with undefined');
promise_test(t => {
@@ -394,7 +394,7 @@ self.templatedRSClosedReader = (label, factory) => {
promise_rejects(t, new TypeError(), closedAfter)
]);
- }, 'releasing the lock should cause closed to reject and change identity');
+ }, label + ': releasing the lock should cause closed to reject and change identity');
promise_test(() => {
@@ -412,7 +412,7 @@ self.templatedRSClosedReader = (label, factory) => {
cancelPromise2.then(v => assert_equals(v, undefined, 'second cancel() should fulfill with undefined'))
]);
- }, 'cancel() should return a distinct fulfilled promise each time');
+ }, label + ': cancel() should return a distinct fulfilled promise each time');
};
self.templatedRSErroredReader = (label, factory, error) => {
@@ -423,7 +423,7 @@ self.templatedRSErroredReader = (label, factory, error) => {
const reader = factory().reader;
return promise_rejects(t, error, reader.closed);
- }, 'closed should reject with the error');
+ }, label + ': closed should reject with the error');
promise_test(t => {
@@ -439,14 +439,14 @@ self.templatedRSErroredReader = (label, factory, error) => {
return promise_rejects(t, new TypeError(), closedAfter);
});
- }, 'releasing the lock should cause closed to reject and change identity');
+ }, label + ': releasing the lock should cause closed to reject and change identity');
promise_test(t => {
const reader = factory().reader;
return promise_rejects(t, error, reader.read());
- }, 'read() should reject with the error');
+ }, label + ': read() should reject with the error');
};
self.templatedRSTwoChunksOpenReader = (label, factory, chunks) => {
@@ -465,7 +465,7 @@ self.templatedRSTwoChunksOpenReader = (label, factory, chunks) => {
})
]);
- }, 'calling read() twice without waiting will eventually give both chunks (sequential)');
+ }, label + ': calling read() twice without waiting will eventually give both chunks (sequential)');
promise_test(() => {
@@ -479,14 +479,14 @@ self.templatedRSTwoChunksOpenReader = (label, factory, chunks) => {
});
});
- }, 'calling read() twice without waiting will eventually give both chunks (nested)');
+ }, label + ': calling read() twice without waiting will eventually give both chunks (nested)');
test(() => {
const reader = factory().reader;
assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');
- }, 'read() should return distinct promises each time');
+ }, label + ': read() should return distinct promises each time');
promise_test(() => {
@@ -510,7 +510,7 @@ self.templatedRSTwoChunksOpenReader = (label, factory, chunks) => {
return Promise.all([promise1, promise2, promise3]);
- }, 'cancel() after a read() should still give that single read result');
+ }, label + ': cancel() after a read() should still give that single read result');
};
self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
@@ -532,7 +532,7 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
})
]);
- }, 'third read(), without waiting, should give { value: undefined, done: true } (sequential)');
+ }, label + ': third read(), without waiting, should give { value: undefined, done: true } (sequential)');
promise_test(() => {
@@ -550,7 +550,7 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
});
});
- }, 'third read(), without waiting, should give { value: undefined, done: true } (nested)');
+ }, label + ': third read(), without waiting, should give { value: undefined, done: true } (nested)');
promise_test(() => {
@@ -570,7 +570,8 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
return promise;
- }, 'draining the stream via read() should cause the reader closed promise to fulfill, but locked stays true');
+ }, label +
+ ': draining the stream via read() should cause the reader closed promise to fulfill, but locked stays true');
promise_test(() => {
@@ -589,7 +590,7 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
return promise;
- }, 'releasing the lock after the stream is closed should cause locked to become false');
+ }, label + ': releasing the lock after the stream is closed should cause locked to become false');
promise_test(t => {
@@ -603,7 +604,7 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
promise_rejects(t, new TypeError(), reader.read())
]);
- }, 'releasing the lock should cause further read() calls to reject with a TypeError');
+ }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');
promise_test(() => {
@@ -630,5 +631,5 @@ self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {
return promise;
- }, 'reader\'s closed property always returns the same promise');
+ }, label + ': reader\'s closed property always returns the same promise');
};

Powered by Google App Engine
This is Rietveld 408576698