mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 00:28:06 +02:00
Use LoopbackPort
in the "message_handler" unit-tests
There's no good reason, as far as I can tell, to duplicate the functionality of the `LoopbackPort` in the unit-tests. The only difference between the implementations is that `LoopbackPort` mimics the (native) structured cloning, however that shouldn't matter here since the tests are only sending "simple" data (strings respectively arrays with numbers). Furthermore the patch also changes `LoopbackPort` to default to using "structured cloning" and deferred invocation of the listeners, since native typed array support is now a requirement for using the PDF.js library.
This commit is contained in:
parent
44d8afd46b
commit
89caaf4071
2 changed files with 9 additions and 38 deletions
|
@ -1205,7 +1205,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||
})();
|
||||
|
||||
class LoopbackPort {
|
||||
constructor(defer) {
|
||||
constructor(defer = true) {
|
||||
this._listeners = [];
|
||||
this._defer = defer;
|
||||
this._deferred = Promise.resolve(undefined);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue