Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: LayoutTests/media/track/opera/interfaces/TextTrackCue/onexit.html

Issue 72543003: Update TextTrackCue tests to use VTTCue where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <title>TextTrackCue.onexit</title> 2 <title>TextTrackCue.onexit</title>
3 <script src=../../../../../resources/testharness.js></script> 3 <script src=../../../../../resources/testharness.js></script>
4 <script src=../../../../../resources/testharnessreport.js></script> 4 <script src=../../../../../resources/testharnessreport.js></script>
5 <div id=log></div> 5 <div id=log></div>
6 <script> 6 <script>
7 setup(function(){ 7 setup(function(){
8 window.c1 = new TextTrackCue(0, 1, 'text1'); 8 window.c1 = new VTTCue(0, 1, 'text1');
9 window.ev = new Event('exit'); 9 window.ev = new Event('exit');
10 window.ran = false; 10 window.ran = false;
11 window.cb = function() { ran = true; }; 11 window.cb = function() { ran = true; };
12 }); 12 });
13 test(function(){ 13 test(function(){
14 assert_equals(c1.onexit, null, 'initial value'); 14 assert_equals(c1.onexit, null, 'initial value');
15 c1.onexit = undefined; 15 c1.onexit = undefined;
16 assert_equals(c1.onexit, null, 'assigning undefined'); 16 assert_equals(c1.onexit, null, 'assigning undefined');
17 c1.onexit = cb; 17 c1.onexit = cb;
18 assert_equals(c1.onexit, cb, 'assigning onexit'); 18 assert_equals(c1.onexit, cb, 'assigning onexit');
19 c1.dispatchEvent(ev); 19 c1.dispatchEvent(ev);
20 assert_true(ran, 'dispatching event'); 20 assert_true(ran, 'dispatching event');
21 c1.onexit = null; 21 c1.onexit = null;
22 assert_equals(c1.onexit, null, 'assigning null'); 22 assert_equals(c1.onexit, null, 'assigning null');
23 ran = false; 23 ran = false;
24 c1.dispatchEvent(ev); 24 c1.dispatchEvent(ev);
25 assert_false(ran, 'dispatching event after nulling onexit'); 25 assert_false(ran, 'dispatching event after nulling onexit');
26 }); 26 });
27 test(function(){ 27 test(function(){
28 c1.addEventListener('exit', cb, false); 28 c1.addEventListener('exit', cb, false);
29 c1.dispatchEvent(ev); 29 c1.dispatchEvent(ev);
30 assert_true(ran); 30 assert_true(ran);
31 c1.removeEventListener('exit', cb, false); 31 c1.removeEventListener('exit', cb, false);
32 ran = false; 32 ran = false;
33 c1.dispatchEvent(ev); 33 c1.dispatchEvent(ev);
34 assert_false(ran); 34 assert_false(ran);
35 }, 'TextTrackCue.addEventListener/removeEventListener'); 35 }, 'TextTrackCue.addEventListener/removeEventListener');
36 </script> 36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698