Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a Work-In-Progress to remove the `XHRMock` utils from our tests, which monkey-patched the browser's `XMLHttpRequest` API to allow mocking requests, "locking" them, redirecting them and so on (kind of like sinon.js's [nise](https://github.com/sinonjs/nise) which was a major inspiration but with added locking/unlocking capabilities). The reasons for doing this are: - It only worked for `XMLHttpRequest` and not for the `fetch` browser API which we use to fetch low-latency segments for now (due to some API differences between the two) and plan to use for more things in the future. Adding support for `fetch` looks like huge work (we have to re-implement the most part of the API in JS - may be fun but there are funnier tasks which are also more useful :p) - We have RxPlayer API which allows an application to provide its own fetching logic (`manifestLoader` and `segmentLoader`) which covers almost all fetching cases (it does not cover XLink charging, low-latency segment fetching and future Content Steering Manifest fetching) and covers all fetching cases currently done by `XHRMock`. - The now probable incoming future in-Worker feature of the RxPlayer cannot easily rely on monkey-patching its API, at least in integration tests (well, in all honesty, we will have to think about how we'll be testing this feature). - It was complex, looked like an NIH-y `fakeServer` implementation. Removing it in favor or simpler solutions is just easier to understand. This is not completely done yet.
- Loading branch information