Commit Graph

66 Commits

Author SHA1 Message Date
Jacob Trimble f5cabead8e Don't retry network requests on CRITICAL errors.
Issue #620

Change-Id: I6b659acdccf5d893022f3474b45020482f543550
2017-04-05 19:51:13 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
This adds a severity field to Error objects.  This can be used to
detect whether an error is recoverable.  All the same errors are still
reported so the field can be ignored.

There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
  load() again

Closes #564

Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
2017-04-04 23:57:59 +00:00
Joey Parrish b089375a95 Improve NetworkingEngine test coverage
Change-Id: I6c3f6347e3d7e647b48bf8d1a3e7da9d7edf1859
2017-03-21 19:08:14 +00:00
Jacob Trimble 40bd34d8ac Add support for special cache header.
This allows network responses to have an X-Shaka-From-Cache header to
indicate that the response was somehow from a cache and should be
ignored for bandwidth calculations.  For example, this can be from a
service worker intercepting the request.

Change-Id: I4dfdf4211921b7205febb58f1e80967f0c4841cd
2017-03-03 19:53:17 +00:00
Jacob Trimble 6f7d937d2f Add Response flag to ignore cache hits.
This adds a field to the network response that will indicate that the
response was from a cache and should be ignored for bandwidth
estimation.

Change-Id: I6b02e9d4fb3be02731bdf0a2a46bc5ce5f11e302
2017-02-16 21:17:25 +00:00
Joey Parrish d22900692e Upgrade jasmine-ajax and enable redirect test
Change-Id: I514090f160099ad4afc3446100a4753f714fbbff
2017-01-18 21:34:02 +00:00
Theodore Abshire 8b2212c65d Enabled asynchronous response filters.
Also updated externs.

Issue #610

Change-Id: I4c9539442d6fb77781296ea1acf123b3653e3b40
2017-01-09 17:34:22 +00:00
Theodore Abshire 07c564b4a2 The http plugin now fails on 202 status codes.
Closes #645

Change-Id: Ie20d1de1e8eff30d7656886e2b85d0e39079774a
2017-01-06 21:37:59 +00:00
Theodore Abshire 07ce75273e Allowed network plugins to see the request type.
Closes #602
Change-Id: Ib86389956c4908d94184abe8775d497b09a5f90e
2017-01-06 21:23:09 +00:00
Theodore Abshire abca628239 Added support for asynchronous request filters.
Closes #610
Change-Id: I10d407d6c858f6541e869b834877a2ebbc516694
2017-01-05 15:49:49 -08:00
Jacob Trimble b1711c346d Allow passing durations from scheme plugins.
This allows the networking plugins to pass the duration it took for
the request.  For example, if a plugin were pre-fetching the segment,
this allows the plugin to tell NetworkingEngine about how long it
really took to download.

Closes #621

Change-Id: Ie67e3f99389cf02d5b4a345bde06ccc418b6e91c
2016-12-20 20:17:43 +00:00
Joey Parrish d6616a0ca4 Fix quarantined NetworkingEngine tests
The test flake was caused by a leaked instance of Playhead interfering
with NetworkingEngine unit tests.  The quickest way to reproduce a
failure on the networking tests was to focus the unit tests for
Playhead and NetworkingEngine and run the suite on IE11.

Playhead tests tear down the Playhead object after each test.
However, one test created two Playheads, effectively leaking one.
That leaked Playhead would continue to poll the fake video element
after the test was complete.  Polling used setTimeout.

The NetworkingEngine unit tests would mock setTimeout and show that
the engine was calling it appropriately.  However, the leaked Playhead
would also call setTimeout during the NetworkingEngine test, which
would cause an expectation on the number of calls to fail.

The Playhead tests should clean up after themselves, but the
NetworkingEngine tests should not have to mock global setTimeout in
the first place.  This change not only fixes the Playhead tests, but
isolates NetworkingEngine's use of setTimeout to a private method
which can be mocked without affecting global state.

Change-Id: I94dd7f6c39c25f81c7e4122895ab5fae0feef2cb
2016-11-23 12:05:49 -08:00
Joey Parrish bdd147229a Quarantine tests that are not always passing
This hides 6 tests behind the --quarantined flag.  Without this flag,
these tests will be skipped.  This allows us to get consistent results
from the build bot while we work to fix these tests.

Change-Id: I6cf3921228da1831f71a89cd5802ea48c66752bd
2016-11-23 10:16:30 -08:00
Lucas Gabriel Sánchez 403a141f2c Use data URI content-type for manifest type detection (#550)
* Fix when using Data URIs for the manifest
* update test/net/data_uri_plugin_unit.js to test Data URIs content-type header response
2016-10-19 09:50:07 -07:00
Joey Parrish c1c176a529 Restore ClearKey license server support
- Restore ClearKey as a recognized key system in the DASH parser
 - Query key systems with configured license servers first, so that
   we can continue to differentiate between unavailable key systems
   and under-configured key systems.
 - Add a new ClearKey license server test asset.
 - Update tests.

Closes #403

Change-Id: Id5ef46d2d35a0217d313f03d403058c5c279e878
2016-07-06 17:25:37 -07:00
Leandro Moreira a8c44da4b1 restructures test files 2016-07-01 09:53:30 -03:00