Enable "read with streaming" test in test/unit/network_spec.js
See original GitHub issueThe “read with streaming” test looks like this: https://github.com/mozilla/pdf.js/blob/a4cc85fc5f5cb144b6ee7a7978dc83e906677233/test/unit/network_spec.js#L67-L77
There are two issues here:
- Lines 74 - 76 should use
pending('Streaming not supported by user agent');
instead of an incorrectdone()
call. - With #8768, it seems that the test can be enabled for other browsers (Chrome).
@yurydelendik Can the test be enabled for other browsers?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Part 2: Testing Your Streaming Application
The hands-on tutorial introduced the basics of the Kafka Streams […] ... These utilities enable you to unit test client application in parts....
Read more >Using readable streams - Web APIs | MDN
Using readable streams. As a JavaScript developer, programmatically reading and manipulating streams of data received over the network, chunk by ...
Read more >How to use streams in Node.js - Fauna
Readable streams are used in operations where data is read, such as reading data from a file or streaming video. Writable streams are...
Read more >Streams—The definitive guide - web.dev
The Streams API allows JavaScript to programmatically access streams of ... Stream data is read sequentially in small pieces called chunks.
Read more >Stream | Node.js v19.3.0 Documentation
Readable : streams from which data can be read (for example, fs. ... The optional chunk and encoding arguments allow one final additional...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@choilmto I have updated the MDN pages to be more clear. Take another look if you want to get a better understanding.
Line 70 in the above code refers to the non-standard way of obtaining a response stream in Firefox, via the
xhr.responseType = "moz-chunked-arraybuffer"
(wherexhr
is aXMLHttpRequest
instance) (so the comment has a typo, “array” should be “arraybuffer”).fetch
support does not equate support for streaming responses (see the note at the end of https://github.com/mozilla/pdf.js/issues/6126#issuecomment-130572300). Checking for existence ofReadableStream
would be sufficient though (this was also done in the proposed pull request at #9050).The user agent line is still necessary; Alternatively, feature detection can be used, as shown at: https://github.com/mozilla/pdf.js/blob/edaf4b3173607cf19664ab764e5be0742b51c5a4/src/display/network.js#L55-L72
Resolved!