question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable "read with streaming" test in test/unit/network_spec.js

See original GitHub issue

The “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 incorrect done() 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:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Rob--Wcommented, Dec 13, 2017

@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" (where xhr is a XMLHttpRequest instance) (so the comment has a typo, “array” should be “arraybuffer”).

As an aside, instead of checking for browser support of fetch()

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 of ReadableStream 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

0reactions
s1iqbalcommented, Feb 6, 2018

Resolved!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found