mirror of
https://github.com/servo/servo.git
synced 2025-08-30 01:28:21 +01:00
Update web-platform-tests to revision 9c2bea6dac36e36ba1f489d10c2be42160d8f34f
This commit is contained in:
parent
482923cec2
commit
5c371dd958
459 changed files with 10717 additions and 834 deletions
|
@ -437,3 +437,27 @@ test(() => {
|
|||
test(() => {
|
||||
assert_throws(new RangeError(), () => new TransformStream({ writableType: 'bytes' }), 'constructor should throw');
|
||||
}, 'specifying a defined writableType should throw');
|
||||
|
||||
test(() => {
|
||||
class Subclass extends TransformStream {
|
||||
extraFunction() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
assert_equals(
|
||||
Object.getPrototypeOf(Subclass.prototype), TransformStream.prototype,
|
||||
'Subclass.prototype\'s prototype should be TransformStream.prototype');
|
||||
assert_equals(Object.getPrototypeOf(Subclass), TransformStream,
|
||||
'Subclass\'s prototype should be TransformStream');
|
||||
const sub = new Subclass();
|
||||
assert_true(sub instanceof TransformStream,
|
||||
'Subclass object should be an instance of TransformStream');
|
||||
assert_true(sub instanceof Subclass,
|
||||
'Subclass object should be an instance of Subclass');
|
||||
const readableGetter = Object.getOwnPropertyDescriptor(
|
||||
TransformStream.prototype, 'readable').get;
|
||||
assert_equals(readableGetter.call(sub), sub.readable,
|
||||
'Subclass object should pass brand check');
|
||||
assert_true(sub.extraFunction(),
|
||||
'extraFunction() should be present on Subclass object');
|
||||
}, 'Subclassing TransformStream should work');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue