 sourceBuffer.appendBuffer(mediaData);

              test.waitForExpectedEvents(function()
              {
                  assert_false(sourceBuffer.updating, 'updating attribute is false');

                  test.expectEvent(mediaSource, 'sourceended', 'MediaSource sourceended event');
                  mediaSource.endOfStream();
                  assert_equals(mediaSource.readyState, 'ended', 'MediaSource readyState is \'ended\'');
              });

              test.waitForExpectedEvents(function()