* Rename SegmentIndex functions to shorter names.
* Add first() and last() functions for convenience.
* Throw exceptions for out of range errors.
* Handle more corner-cases in merge().
* Add more unit tests.
Change-Id: If875cd766e7091504c028413694326fcdf2aae5b
If a stream insertion didn't complete successfully, it was possible an error
would occur during the next stream insertion due to a key (streamId) conflict.
Updated to always take the max next stream id from the indexStore/contentStore
and to try to delete partially inserted streams.
Change-Id: I85c379a6ef17853da28ae873c448873006b1dce4
Chrome 42+ is crashing when we insert roughly 64MB of data into the
database at a time. The database now tries to batch up 1MB of
segments, which means only single segments will be inserted for high
bitrate content, but we will still get a performance boost from
batching up segments for low bitrate content.
Change-Id: I3205b108dc089ea2901ea6b9eae5125901535f0c
Tests were failing if an existing database had a greater version
number. This was an artifact of an older version of ContentDatabase
which used a different version number.
Tests would also fail if one of the 'stores a stream' tests was run
several times in a row, such that the stream ID had more than one
digit. The reference matcher now accepts multi-digit IDs.
Change-Id: I8d8949e46bd0720abd761248790b2ee5965ff4a1
Rejected promises now pass an Error object instead of a simple event.
This causes test failures to display useful error messages now.
Change-Id: I9d9a756e84d204185ca9a2e36ca92ef814d05e4d