Scenarios of this layout test:
Load media with sufficient data to play for 2s. Start playing. Update media duration to less than 2s = 1.5s. Seek to time greater than new duration, but less than previous duration. Expect events as specified in test. Confirm that, after seek, current time is set to new duration.

Load media with full playback data. Start playing. Seek to time greater than media duration. Expect events as specified in test. Confirm that, after seek, current time is set to duration.


Also in this CL: moving an existing utility function to mediasource-utils.js. This function, getSegment, is also used in mediasource-seek-during-pending-seek.html.

BUG=None

Review URL: https://chromiumcodereview.appspot.com/23592022

git-svn-id: svn://svn.chromium.org/blink/trunk@157814 bbb929c8-8fbe-4397-9dbb-9b2b20218538