Commit 7dc1fed5 authored by Sriram's avatar Sriram Committed by Commit Bot

Remove tests in media/track/opera/interfaces/TextTrackCue/

Removing the following test cases infavor of the web platform tests in
html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/

1. endTime.html
2. id.html
3. onenter.html
4. onexit.html
5. pauseOnExit.html
6. startTime.html
7. track.html

Bug: 782555
Change-Id: Ie80b99918d2a230f3b0e1c72a8ed22a381707d38
Reviewed-on: https://chromium-review.googlesource.com/768354Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#516258}
parent bc6fe9d0
<!doctype html>
<title>TextTrackCue.endTime</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.video = document.createElement('video');
window.t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
});
test(function(){
var c1 = new VTTCue(-2, -1, 'text1');
assert_equals(c1.endTime, -1);
c1.endTime = c1.endTime;
assert_equals(c1.endTime, -1);
assert_throws(new TypeError(), function(){ c1.endTime = NaN; });
assert_throws(new TypeError(), function(){ c1.endTime = +Infinity; });
assert_throws(new TypeError(), function(){ c1.endTime = -Infinity; });
}, document.title+', script-created cue');
var t_parsed = async_test(document.title+', parsed cue');
t_parsed.step(function(){
var t = document.createElement('track');
t.onload = this.step_func(function(){
var c = t.track.cues;
assert_equals(c[0].endTime, 0.001);
assert_equals(c[1].endTime, 3600.001);
this.done();
});
t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
'\n\nfoobar\n01:00:00.000 --> 01:00:00.001\ntest');
t.track.mode = 'showing';
video.appendChild(t);
});
</script>
<!doctype html>
<title>TextTrackCue.id</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.video = document.createElement('video');
window.t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
});
test(function(){
var c1 = new VTTCue(0, 1, 'text1');
c1.id = 'id1\r\n\u0000';
assert_equals(c1.id, 'id1\r\n\u0000');
c1.id = c1.id;
assert_equals(c1.id, 'id1\r\n\u0000');
c1.id = null;
assert_equals(c1.id, 'null');
}, document.title+', script-created cue');
var t_parsed = async_test(document.title+', parsed cue');
t_parsed.step(function(){
var t = document.createElement('track');
t.onload = this.step_func(function(){
var c = t.track.cues;
assert_equals(c[0].id, '');
assert_equals(c[1].id, 'foobar');
this.done();
});
t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
'\n\nfoobar\n00:00:00.000 --> 00:00:00.001\ntest');
t.track.mode = 'showing';
video.appendChild(t);
});
</script>
This is a testharness.js-based test.
FAIL TextTrackCue.onenter assert_true: dispatching event expected true got false
FAIL TextTrackCue.addEventListener/removeEventListener assert_true: expected true got false
Harness: the test ran to completion.
<!doctype html>
<title>TextTrackCue.onenter</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.c1 = new VTTCue(0, 1, 'text1');
window.ev = new Event('enter');
window.ran = false;
window.cb = function() { ran = true; };
});
test(function(){
assert_equals(c1.onenter, null, 'initial value');
c1.onenter = undefined;
assert_equals(c1.onenter, null, 'assigning undefined');
c1.onenter = cb;
assert_equals(c1.onenter, cb, 'assigning onenter');
c1.dispatchEvent(ev);
assert_true(ran, 'dispatching event');
c1.onenter = null;
assert_equals(c1.onenter, null, 'assigning null');
ran = false;
c1.dispatchEvent(ev);
assert_false(ran, 'dispatching event after nulling onenter');
});
test(function(){
c1.addEventListener('enter', cb, false);
c1.dispatchEvent(ev);
assert_true(ran);
c1.removeEventListener('enter', cb, false);
ran = false;
c1.dispatchEvent(ev);
assert_false(ran);
}, 'TextTrackCue.addEventListener/removeEventListener');
</script>
This is a testharness.js-based test.
FAIL TextTrackCue.onexit assert_true: dispatching event expected true got false
FAIL TextTrackCue.addEventListener/removeEventListener assert_true: expected true got false
Harness: the test ran to completion.
<!doctype html>
<title>TextTrackCue.onexit</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.c1 = new VTTCue(0, 1, 'text1');
window.ev = new Event('exit');
window.ran = false;
window.cb = function() { ran = true; };
});
test(function(){
assert_equals(c1.onexit, null, 'initial value');
c1.onexit = undefined;
assert_equals(c1.onexit, null, 'assigning undefined');
c1.onexit = cb;
assert_equals(c1.onexit, cb, 'assigning onexit');
c1.dispatchEvent(ev);
assert_true(ran, 'dispatching event');
c1.onexit = null;
assert_equals(c1.onexit, null, 'assigning null');
ran = false;
c1.dispatchEvent(ev);
assert_false(ran, 'dispatching event after nulling onexit');
});
test(function(){
c1.addEventListener('exit', cb, false);
c1.dispatchEvent(ev);
assert_true(ran);
c1.removeEventListener('exit', cb, false);
ran = false;
c1.dispatchEvent(ev);
assert_false(ran);
}, 'TextTrackCue.addEventListener/removeEventListener');
</script>
<!doctype html>
<title>TextTrackCue.pauseOnExit</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.video = document.createElement('video');
window.t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
});
test(function(){
var c1 = new VTTCue(0, 1, 'text1');
assert_equals(c1.pauseOnExit, false);
c1.pauseOnExit = null;
assert_equals(c1.pauseOnExit, false);
c1.pauseOnExit = 'foo';
assert_equals(c1.pauseOnExit, true);
}, document.title+', script-created cue');
var t_parsed = async_test(document.title+', parsed cue');
t_parsed.step(function(){
var t = document.createElement('track');
t.onload = this.step_func(function(){
var c1 = t.track.cues[0];
assert_equals(c1.pauseOnExit, false);
c1.pauseOnExit = null;
assert_equals(c1.pauseOnExit, false);
c1.pauseOnExit = 'foo';
assert_equals(c1.pauseOnExit, true);
this.done();
});
t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest');
t.track.mode = 'showing';
video.appendChild(t);
});
</script>
<!doctype html>
<title>TextTrackCue.startTime</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.video = document.createElement('video');
window.t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
});
test(function(){
var c1 = new VTTCue(-1, 1, 'text1');
assert_equals(c1.startTime, -1);
c1.startTime = c1.startTime;
assert_equals(c1.startTime, -1);
assert_throws(new TypeError(), function(){ c1.startTime = NaN; });
assert_throws(new TypeError(), function(){ c1.startTime = +Infinity; });
assert_throws(new TypeError(), function(){ c1.startTime = -Infinity; });
}, document.title+', script-created cue');
var t_parsed = async_test(document.title+', parsed cue');
t_parsed.step(function(){
var t = document.createElement('track');
t.onload = this.step_func(function(){
var c = t.track.cues;
assert_equals(c[0].startTime, 0);
assert_equals(c[1].startTime, 3600);
this.done();
});
t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
'\n\nfoobar\n01:00:00.000 --> 01:00:00.001\ntest');
t.track.mode = 'showing';
video.appendChild(t);
});
</script>
<!doctype html>
<title>TextTrackCue.track</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
window.video = document.createElement('video');
window.t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
});
test(function(){
var c1 = new VTTCue(0, 1, 'text1');
assert_equals(c1.track, null);
t1.addCue(c1);
assert_equals(c1.track, t1);
t1.removeCue(c1);
assert_equals(c1.track, null);
}, document.title+', script-created cue');
var t_parsed = async_test(document.title+', parsed cue');
t_parsed.step(function(){
var t = document.createElement('track');
t.onload = this.step_func(function(){
var c = t.track.cues[0];
assert_equals(c.track, t.track);
t.track.removeCue(c);
assert_equals(c.track, null);
this.done();
});
t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest');
t.track.mode = 'showing';
video.appendChild(t);
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment