Changeset 225906 in webkit


Ignore:
Timestamp:
Dec 14, 2017 9:04:21 AM (6 years ago)
Author:
romain.bellessort@crf.canon.fr
Message:

[Readable Streams API] Remove properties tests covered by WPT
https://bugs.webkit.org/show_bug.cgi?id=180809

Reviewed by Youenn Fablet.

Removed WebKit properties/methods tests for ReadableByteStreamController,
ReadableStreamBYOBReader and ReadableStreamBYOBRequest. Indeed, these
tests are also present in WPT streams/readable-byte-streams/properties.js.

  • streams/readable-byte-stream-controller-expected.txt: Updated expectations.
  • streams/readable-byte-stream-controller.js: Remove ReadableByteStreamController properties test.
  • streams/readable-stream-byob-reader-expected.txt: Updated expectations.
  • streams/readable-stream-byob-reader.js: Remove ReadableStreamBYOBReader properties test.
  • streams/readable-stream-byob-request-expected.txt: Updated expectations.
  • streams/readable-stream-byob-request.js: Remove ReadableStreamBYOBRequest properties test.
Location:
trunk/LayoutTests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225900 r225906  
     12017-12-14  Romain Bellessort  <romain.bellessort@crf.canon.fr>
     2
     3        [Readable Streams API] Remove properties tests covered by WPT
     4        https://bugs.webkit.org/show_bug.cgi?id=180809
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Removed WebKit properties/methods tests for ReadableByteStreamController,
     9        ReadableStreamBYOBReader and ReadableStreamBYOBRequest. Indeed, these
     10        tests are also present in WPT streams/readable-byte-streams/properties.js.
     11
     12        * streams/readable-byte-stream-controller-expected.txt: Updated expectations.
     13        * streams/readable-byte-stream-controller.js: Remove ReadableByteStreamController properties test.
     14        * streams/readable-stream-byob-reader-expected.txt: Updated expectations.
     15        * streams/readable-stream-byob-reader.js: Remove ReadableStreamBYOBReader properties test.
     16        * streams/readable-stream-byob-request-expected.txt: Updated expectations.
     17        * streams/readable-stream-byob-request.js: Remove ReadableStreamBYOBRequest properties test.
     18
    1192017-12-14  Miguel Gomez  <magomez@igalia.com>
    220
  • trunk/LayoutTests/streams/readable-byte-stream-controller-expected.txt

    r218926 r225906  
    11
    22PASS Creating a ReadableStream with an underlyingSource with type property set to 'bytes' should succeed
    3 PASS ReadableByteStreamController instances should have the correct list of properties
    43PASS Calling error() with a this object different from ReadableByteStreamController should throw a TypeError
    54PASS Calling close() with a this object different from ReadableByteStreamController should throw a TypeError
     
    2726PASS Calling cancel after creating a ReadableStream with an underlyingByteStream's start function returning a rejected promise should result in a promise rejected with the same error
    2827PASS Creating a ReadableStream with an underlyingSource with type property set to 'bytes' should succeed
    29 PASS ReadableByteStreamController instances should have the correct list of properties
    3028PASS Calling error() with a this object different from ReadableByteStreamController should throw a TypeError
    3129PASS Calling close() with a this object different from ReadableByteStreamController should throw a TypeError
  • trunk/LayoutTests/streams/readable-byte-stream-controller.js

    r218926 r225906  
    1010    });
    1111}, "Creating a ReadableStream with an underlyingSource with type property set to 'bytes' should succeed");
    12 
    13 test(() => {
    14     const methods = ['close', 'constructor', 'enqueue', 'error'];
    15     const properties = methods.concat(['byobRequest', 'desiredSize']).sort();
    16 
    17     let controller;
    18 
    19     const rs = new ReadableStream({
    20         start: function(c) {
    21             controller = c;
    22         },
    23         type: "bytes"
    24     });
    25 
    26     const proto = Object.getPrototypeOf(controller);
    27 
    28     assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties);
    29 
    30     for (const m of methods) {
    31         const propDesc = Object.getOwnPropertyDescriptor(proto, m);
    32         assert_equals(propDesc.enumerable, false, 'method should be non-enumerable');
    33         assert_equals(propDesc.configurable, true, 'method should be configurable');
    34         assert_equals(propDesc.writable, true, 'method should be writable');
    35         assert_equals(typeof controller[m], 'function', 'should have be a method');
    36     }
    37 
    38     const byobRequestPropDesc = Object.getOwnPropertyDescriptor(proto, 'byobRequest');
    39     assert_equals(byobRequestPropDesc.enumerable, false, 'byobRequest should be non-enumerable');
    40     assert_equals(byobRequestPropDesc.configurable, true, 'byobRequest should be configurable');
    41     assert_not_equals(byobRequestPropDesc.get, undefined, 'byobRequest should have a getter');
    42     assert_equals(byobRequestPropDesc.set, undefined, 'byobRequest should not have a setter');
    43 
    44     const desiredSizePropDesc = Object.getOwnPropertyDescriptor(proto, 'desiredSize');
    45     assert_equals(desiredSizePropDesc.enumerable, false, 'desiredSize should be non-enumerable');
    46     assert_equals(desiredSizePropDesc.configurable, true, 'desiredSize should be configurable');
    47     assert_not_equals(desiredSizePropDesc.get, undefined, 'desiredSize should have a getter');
    48     assert_equals(desiredSizePropDesc.set, undefined, 'desiredSize should not have a setter');
    49 
    50     assert_equals(controller.close.length, 0, 'close has 0 parameter');
    51     assert_equals(controller.constructor.length, 3, 'constructor has 3 parameters');
    52     assert_equals(controller.enqueue.length, 1, 'enqueue has 1 parameter');
    53     assert_equals(controller.error.length, 1, 'error has 1 parameter');
    54 
    55 }, 'ReadableByteStreamController instances should have the correct list of properties');
    5612
    5713test(function() {
  • trunk/LayoutTests/streams/readable-stream-byob-reader-expected.txt

    r218701 r225906  
    11
    22PASS Getting a ReadableStreamBYOBReader should succeed
    3 PASS ReadableStreamBYOBReader instances should have the correct list of properties
    43PASS Calling getReader() with a this object different from ReadableStream should throw a TypeError
    54PASS Calling getReader({ mode: 'byob' }) with a ReadableStream whose controller is a ReadableStreamDefaultController should throw a TypeError
     
    1615PASS Calling ReadableStreamBYOBReader.read() with a this object different from ReadableStreamBYOBReader should be rejected
    1716PASS Getting a ReadableStreamBYOBReader should succeed
    18 PASS ReadableStreamBYOBReader instances should have the correct list of properties
    1917PASS Calling getReader() with a this object different from ReadableStream should throw a TypeError
    2018PASS Calling getReader({ mode: 'byob' }) with a ReadableStream whose controller is a ReadableStreamDefaultController should throw a TypeError
  • trunk/LayoutTests/streams/readable-stream-byob-reader.js

    r218701 r225906  
    1111    rs.getReader({ mode: 'byob' });
    1212}, "Getting a ReadableStreamBYOBReader should succeed");
    13 
    14 test(() => {
    15     const methods = ['cancel', 'constructor', 'read', 'releaseLock'];
    16     const properties = methods.concat(['closed']).sort();
    17 
    18     const rs = new ReadableStream({ type: "bytes" });
    19     const reader = rs.getReader({ mode: 'byob' });
    20 
    21     const proto = Object.getPrototypeOf(reader);
    22 
    23     assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties);
    24 
    25     for (const m of methods) {
    26         const propDesc = Object.getOwnPropertyDescriptor(proto, m);
    27         assert_equals(propDesc.enumerable, false, 'method should be non-enumerable');
    28         assert_equals(propDesc.configurable, true, 'method should be configurable');
    29         assert_equals(propDesc.writable, true, 'method should be writable');
    30         assert_equals(typeof reader[m], 'function', 'should have be a method');
    31     }
    32 
    33     const closedPropDesc = Object.getOwnPropertyDescriptor(proto, 'closed');
    34     assert_equals(closedPropDesc.enumerable, false, 'closed should be non-enumerable');
    35     assert_equals(closedPropDesc.configurable, true, 'closed should be configurable');
    36     assert_not_equals(closedPropDesc.get, undefined, 'closed should have a getter');
    37     assert_equals(closedPropDesc.set, undefined, 'closed should not have a setter');
    38 
    39     assert_equals(reader.cancel.length, 1, 'cancel has 1 parameter');
    40     assert_equals(reader.constructor.length, 1, 'constructor has 1 parameter');
    41     assert_equals(reader.read.length, 1, 'read has 1 parameter');
    42     assert_equals(reader.releaseLock.length, 0, 'releaseLock has 0 parameter');
    43 
    44 }, 'ReadableStreamBYOBReader instances should have the correct list of properties');
    4513
    4614test(function() {
  • trunk/LayoutTests/streams/readable-stream-byob-request-expected.txt

    r215043 r225906  
    11
    2 PASS ReadableStreamBYOBRequest instances should have the correct list of properties
    32PASS By default, byobRequest should be undefined
    43PASS byobRequest.view length should be equal to autoAllocateChunkSize
     
    1716PASS When using autoAllocateChunkSize, calling respondWithNewView() should throw a RangeError if view.byteOffset is different from 0
    1817PASS When using autoAllocateChunkSize, calling respondWithNewView() should throw a RangeError if view.byteLength is different from autoAllocateChunkSize
    19 PASS ReadableStreamBYOBRequest instances should have the correct list of properties
    2018PASS By default, byobRequest should be undefined
    2119PASS byobRequest.view length should be equal to autoAllocateChunkSize
  • trunk/LayoutTests/streams/readable-stream-byob-request.js

    r215043 r225906  
    55}
    66
    7 test(() => {
    8     const methods = ['constructor', 'respond', 'respondWithNewView'];
    9     const properties = methods.concat(['view']).sort();
    10 
    11     let controller;
    12 
    13     // FIXME: Remove next line when bug https://bugs.webkit.org/show_bug.cgi?id=167697
    14     // is fixed. For the moment, so that test may pass, we have to insert a reference
    15     // to Uint8Array here (otherwise, the private variable cannot be resolved).
    16     const d = new Uint8Array(1);
    17 
    18     // Specifying autoAllocateChunkSize and calling read() are steps that allow
    19     // getting a ReadableStreamBYOBRequest returned instead of undefined. The
    20     // purpose here is just to get such an object.
    21     const rs = new ReadableStream({
    22         autoAllocateChunkSize: 128,
    23         start: function(c) {
    24             controller = c;
    25         },
    26         type: "bytes"
    27     });
    28 
    29     rs.getReader().read();
    30     const byobReq = controller.byobRequest;
    31 
    32     const proto = Object.getPrototypeOf(byobReq);
    33 
    34     assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties);
    35 
    36     for (const m of methods) {
    37         const propDesc = Object.getOwnPropertyDescriptor(proto, m);
    38         assert_equals(propDesc.enumerable, false, 'method should be non-enumerable');
    39         assert_equals(propDesc.configurable, true, 'method should be configurable');
    40         assert_equals(propDesc.writable, true, 'method should be writable');
    41         assert_equals(typeof byobReq[m], 'function', 'should have be a method');
    42     }
    43 
    44     const viewPropDesc = Object.getOwnPropertyDescriptor(proto, 'view');
    45     assert_equals(viewPropDesc.enumerable, false, 'view should be non-enumerable');
    46     assert_equals(viewPropDesc.configurable, true, 'view should be configurable');
    47     assert_not_equals(viewPropDesc.get, undefined, 'view should have a getter');
    48     assert_equals(viewPropDesc.set, undefined, 'view should not have a setter');
    49 
    50     assert_equals(byobReq.constructor.length, 2, 'constructor has 2 parameters');
    51     assert_equals(byobReq.respond.length, 1, 'respond has 1 parameter');
    52     assert_equals(byobReq.respondWithNewView.length, 1, 'respondWithNewView has 1 parameter');
    53 
    54 }, 'ReadableStreamBYOBRequest instances should have the correct list of properties');
     7
     8// FIXME: Remove next line when bug https://bugs.webkit.org/show_bug.cgi?id=167697
     9// is fixed. For the moment, so that test may pass, we have to insert a reference
     10// to Uint8Array here (otherwise, the private variable cannot be resolved).
     11const d = new Uint8Array(1);
    5512
    5613test(function() {
Note: See TracChangeset for help on using the changeset viewer.