
              {
                  assert_equals(mediaSource.readyState, 'ended', 'MediaSource readyState is \'ended\'');

                  test.expectEvent(mediaSource, 'sourceopen', 'MediaSource sourceopen event');
                  sourceBuffer.mode = 'segments';

                  assert_equals(mediaSource.readyState, 'open', 'MediaSource readyState is \'open\'');
              });

              test.waitForExpectedEvents(function()
              {
                  assert_equals(mediaSource.readyStat