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

Side by Side Diff: LayoutTests/media/media-controls-invalid-url.html

Issue 411833006: Use the mediaControlsButton() helper more in media tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/media/media-controls.js ('k') | LayoutTests/media/video-controls-toggling.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 src=media-controls.js></script> 6 <script src=media-controls.js></script>
7 <script> 7 <script>
8 var video; 8 var video;
9 9
10 function init() 10 function init()
11 { 11 {
12 video = document.getElementsByTagName("video")[0]; 12 video = document.getElementsByTagName("video")[0];
13 video.src = findMediaFile("video", "content/test"); 13 video.src = findMediaFile("video", "content/test");
14 14
15 waitForEventOnce("canplaythrough", start); 15 waitForEventOnce("canplaythrough", start);
16 waitForEvent("seeked", seeked); 16 waitForEvent("seeked", seeked);
17 waitForEvent("error", error); 17 waitForEvent("error", error);
18 } 18 }
19 19
20 function getTimeLineValue() 20 function getTimeLineValue()
21 { 21 {
22 var timeline; 22 return mediaControlsButton(video, "timeline").value;
23 var shadowRoot = internals.shadowRoot(video);
24
25 timeline = mediaControlsElement(shadowRoot.firstChild.firstChild , '-webkit-media-controls-timeline');
26
27 if(!timeline)
28 throw "Faild to find -webkit-media-controls-timeline";
29
30 return timeline.value;
31 } 23 }
32 24
33 function error() 25 function error()
34 { 26 {
35 try { 27 try {
36 testExpected("getTimeLineValue()", video.currentTime); 28 testExpected("getTimeLineValue()", video.currentTime);
37 endTest(); 29 endTest();
38 } catch (exception) { 30 } catch (exception) {
39 failTest(exception.description); 31 failTest(exception.description);
40 } 32 }
(...skipping 27 matching lines...) Expand all
68 } 60 }
69 </script> 61 </script>
70 </head> 62 </head>
71 <body onload="init()"> 63 <body onload="init()">
72 <p>This tests that media element controls are reset to their default sta te when the src is changed to an invalid url.</p> 64 <p>This tests that media element controls are reset to their default sta te when the src is changed to an invalid url.</p>
73 <p>This test only runs in DRT!</p> 65 <p>This test only runs in DRT!</p>
74 <video controls></video> 66 <video controls></video>
75 <div id="console"></div> 67 <div id="console"></div>
76 </body> 68 </body>
77 </html> 69 </html>
OLDNEW
« no previous file with comments | « LayoutTests/media/media-controls.js ('k') | LayoutTests/media/video-controls-toggling.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698