Skip to content

Commit

Permalink
Use test.step_func() in mediasource-append-buffer.html
Browse files Browse the repository at this point in the history
Part of #11269.
  • Loading branch information
zcorpan committed Jun 20, 2018
1 parent d2d67bd commit d093f88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions media-source/mediasource-append-buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@
loadedmetadataCalled = true;
e.target.removeEventListener(e.type, metadata);
});
sourceBuffer.addEventListener("updateend", function updateend(e) {
sourceBuffer.addEventListener("updateend", test.step_func(function updateend(e) {
assert_true(loadedmetadataCalled);
assert_equals(mediaElement.readyState, mediaElement.HAVE_METADATA);
e.target.removeEventListener(e.type, updateend);
});
}));
test.expectEvent(sourceBuffer, "updateend", "remainingInitSegment append ended.");
test.expectEvent(mediaElement, "loadedmetadata", "loadedmetadata event received.");
sourceBuffer.appendBuffer(initSegment);
Expand All @@ -444,11 +444,11 @@
loadeddataCalled = true;
e.target.removeEventListener(e.type, loadeddata);
});
sourceBuffer.addEventListener("updateend", function updateend(e) {
sourceBuffer.addEventListener("updateend", test.step_func(function updateend(e) {
assert_true(loadeddataCalled);
assert_greater_than_equal(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA);
e.target.removeEventListener(e.type, updateend);
});
}));
test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended.");
test.expectEvent(mediaElement, "loadeddata", "loadeddata fired.");
sourceBuffer.appendBuffer(mediaSegment);
Expand Down

0 comments on commit d093f88

Please sign in to comment.