Bug 1278151 - Fix CompareCuesByTime for the web-platform/meta/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html. r=rillian

MozReview-Commit-ID: KLGqF55DnhI

--HG--
extra : rebase_source : f8e9c2358bab95e332990afdc600148899ee04a7
This commit is contained in:
bechen 2016-06-21 16:26:35 +08:00
Родитель 1998cc0732
Коммит c2f769c9f2
4 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -14,13 +14,12 @@ class CompareCuesByTime
{
public:
bool Equals(TextTrackCue* aOne, TextTrackCue* aTwo) const {
return aOne->StartTime() == aTwo->StartTime() &&
aOne->EndTime() == aTwo->EndTime();
return false;
}
bool LessThan(TextTrackCue* aOne, TextTrackCue* aTwo) const {
return aOne->StartTime() < aTwo->StartTime() ||
(aOne->StartTime() == aTwo->StartTime() &&
aOne->EndTime() < aTwo->EndTime());
aOne->EndTime() >= aTwo->EndTime());
}
};

Просмотреть файл

@ -101,6 +101,9 @@ void
TextTrackList::AddTextTrack(TextTrack* aTextTrack,
const CompareTextTracks& aCompareTT)
{
if (mTextTracks.Contains(aTextTrack)) {
return;
}
if (mTextTracks.InsertElementSorted(aTextTrack, aCompareTT)) {
aTextTrack->SetTextTrackList(this);
CreateAndDispatchTrackEventRunner(aTextTrack, NS_LITERAL_STRING("addtrack"));

Просмотреть файл

@ -41,7 +41,7 @@ video.addEventListener("loadedmetadata",
// Set mode to hidden so that the active cue lists are being updated.
trackElement.track.mode = "hidden";
var expected = [[1, 2], [1, 3], [2, 3], [2, 4], [3, 4]];
var expected = [[1, 3], [1, 2], [2, 4], [2, 3], [3, 4]];
var cueList = trackElement.track.cues;
is(cueList.length, expected.length, "Cue list length should be 5.");

Просмотреть файл

@ -1,8 +1,5 @@
[cues.html]
type: testharness
[TextTrack.cues, changing order]
expected: FAIL
[TextTrack.cues, default attribute]
expected: FAIL