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

Side by Side Diff: LayoutTests/media/track/track-cue-container-rendering-position.html

Issue 533073003: Force layout to make a track rendering test non-flaky (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/TestExpectations ('k') | no next file » | 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 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 5
6 <script src=../media-file.js></script> 6 <script src=../media-file.js></script>
7 <script src=../video-test.js></script> 7 <script src=../video-test.js></script>
8 <script src=../media-controls.js></script> 8 <script src=../media-controls.js></script>
9 9
10 <script> 10 <script>
11 11
12 var cueDisplayElement; 12 var cueDisplayElement;
13 13
14 function testPosition() 14 function testPosition()
15 { 15 {
16 if (!window.internals) { 16 if (!window.internals) {
17 consoleWrite("<br><b>** This test only works in DRT! **<" + "/b> "); 17 consoleWrite("<br><b>** This test only works in DRT! **<" + "/b> ");
18 return; 18 return;
19 } 19 }
20 20
21 consoleWrite(""); 21 consoleWrite("");
22 cueDisplayElement = textTrackDisplayElement(video, 'display', 0); 22 cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
23 document.body.offsetTop; // Force layout.
23 testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75 )", true); 24 testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75 )", true);
fs 2014/09/03 10:33:02 Any idea why reading cueDisplayElement.offsetTop i
philipj_slow 2014/09/03 11:31:55 While debugging I replaced it with a constant and
24 endTest(); 25 endTest();
25 } 26 }
26 27
27 function loaded() 28 function loaded()
28 { 29 {
29 consoleWrite("The top of the text track container should be in the b ottom 25% of the video element."); 30 consoleWrite("The top of the text track container should be in the b ottom 25% of the video element.");
30 31
31 findMediaElement(); 32 findMediaElement();
32 video.src = findMediaFile('video', '../content/test'); 33 video.src = findMediaFile('video', '../content/test');
33 waitForEvent('canplaythrough', testPosition); 34 waitForEvent('canplaythrough', testPosition);
34 } 35 }
35 36
36 </script> 37 </script>
37 </head> 38 </head>
38 <body onload="loaded()"> 39 <body onload="loaded()">
39 <video controls> 40 <video controls>
40 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind ="captions" > 41 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind ="captions" >
41 <track src="captions-webvtt/simple-captions.vtt" kind="captions" > 42 <track src="captions-webvtt/simple-captions.vtt" kind="captions" >
42 <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" > 43 <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" >
43 <track src="captions-webvtt/captions-fast.vtt" kind="captions" > 44 <track src="captions-webvtt/captions-fast.vtt" kind="captions" >
44 <track src="captions-webvtt/captions-html.vtt" kind="captions" > 45 <track src="captions-webvtt/captions-html.vtt" kind="captions" >
45 <track src="captions-webvtt/captions.vtt" kind="captions" default> 46 <track src="captions-webvtt/captions.vtt" kind="captions" default>
46 </video> 47 </video>
47 </body> 48 </body>
48 </html> 49 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698