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

Side by Side Diff: LayoutTests/media/media-controller-playbackrate.html

Issue 848853003: Revert of Relanding 'Always notify the MediaPlayer of any seek' patch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src=media-file.js></script> 4 <script src=media-file.js></script>
5 <script src=video-test.js></script> 5 <script src=video-test.js></script>
6 <script> 6 <script>
7 var start = function() 7 var start = function() {
8 {
9 findMediaElement(); 8 findMediaElement();
10 waitForEventOnce('canplay',canplay); 9 waitForEvent('canplay',canplay);
11 video.src = findMediaFile('video', 'content/test'); 10 video.src = findMediaFile('video', 'content/test');
12 }; 11 };
13 12
14 var canplay = function() 13 var canplay = function() {
15 {
16 video.mediaGroup = "group"; 14 video.mediaGroup = "group";
17 15
18 // Test non-finite rates. 16 // Test non-finite rates.
19 testException("video.controller.defaultPlaybackRate = -Infinity" , '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaCont roller\': The provided double value is non-finite."'); 17 testException("video.controller.defaultPlaybackRate = -Infinity" , '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaCont roller\': The provided double value is non-finite."');
20 testException("video.controller.defaultPlaybackRate = Infinity", '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaContr oller\': The provided double value is non-finite."'); 18 testException("video.controller.defaultPlaybackRate = Infinity", '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaContr oller\': The provided double value is non-finite."');
21 testException("video.controller.defaultPlaybackRate = NaN", '"Ty peError: Failed to set the \'defaultPlaybackRate\' property on \'MediaController \': The provided double value is non-finite."'); 19 testException("video.controller.defaultPlaybackRate = NaN", '"Ty peError: Failed to set the \'defaultPlaybackRate\' property on \'MediaController \': The provided double value is non-finite."');
22 testException("video.controller.playbackRate = -Infinity", '"Typ eError: Failed to set the \'playbackRate\' property on \'MediaController\': The provided double value is non-finite."'); 20 testException("video.controller.playbackRate = -Infinity", '"Typ eError: Failed to set the \'playbackRate\' property on \'MediaController\': The provided double value is non-finite."');
23 testException("video.controller.playbackRate = Infinity", '"Type Error: Failed to set the \'playbackRate\' property on \'MediaController\': The p rovided double value is non-finite."'); 21 testException("video.controller.playbackRate = Infinity", '"Type Error: Failed to set the \'playbackRate\' property on \'MediaController\': The p rovided double value is non-finite."');
24 testException("video.controller.playbackRate = NaN", '"TypeError : Failed to set the \'playbackRate\' property on \'MediaController\': The provid ed double value is non-finite."'); 22 testException("video.controller.playbackRate = NaN", '"TypeError : Failed to set the \'playbackRate\' property on \'MediaController\': The provid ed double value is non-finite."');
25 23
26 // Test that the controller rate sets the video rate. 24 // Test that the controller rate sets the video rate.
27 video.playbackRate = 0; 25 video.playbackRate = 0;
28 video.defaultPlaybackRate = 0; 26 video.defaultPlaybackRate = 0;
29 video.controller.playbackRate = 0; 27 video.controller.playbackRate = 0;
30 video.controller.defaultPlaybackRate = 0; 28 video.controller.defaultPlaybackRate = 0;
31 29
32 // Wait for the seek initiated by the "bringing up to speed" 30 // Wait for the seek initiated by the "bringing up to speed"
33 // step to complete. 31 // step to complete.
34 waitForEventOnce('seeked', seeked); 32 waitForEventOnce('seeked', seeked);
35 }; 33 };
36 34
37 var seeked = function() 35 var seeked = function() {
38 {
39 waitForEvent('play', play); 36 waitForEvent('play', play);
40 video.play(); 37 video.play();
41 }; 38 };
42 39
43 var play = function() 40 var play = function() {
44 {
45 video.controller.playbackRate = 2; 41 video.controller.playbackRate = 2;
46 waitForEventOnce("playing", function() 42 waitForEventOnce('timeupdate', timeupdate);
47 {
48 waitForEventOnce("timeupdate", timeupdate);
49 });
50 }; 43 };
51 44
52 var timeupdate = function() 45 var timeupdate = function() {
53 {
54 testExpected('video.currentTime', 0, '!='); 46 testExpected('video.currentTime', 0, '!=');
55 endTest(); 47 endTest();
56 }; 48 };
57 </script> 49 </script>
58 </head> 50 </head>
59 <body onload="start()"> 51 <body onload="start()">
60 <video controls></video> 52 <video controls></video>
61 </body> 53 </body>
62 </html> 54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698