| <html> |
| <head> |
| <script> |
| if (window.internals.settings) |
| { |
| // This should not be necessary, but due to crbug.com/372245 style |
| // gets dirtied during layout in LayoutTextTrackContainer which |
| // causes assertions to fail when Document::scrollingElement is |
| // queried during compositing update (a valid request). |
| window.internals.settings.setCompositorWorkerEnabled(false); |
| } |
| </script> |
| <script src=../media-file.js></script> |
| <script src=../video-test.js></script> |
| <script src=../media-controls.js></script> |
| <script> |
| |
| var singleLineRect; |
| |
| function testUnbreakableLine() |
| { |
| var multiLineRect = textTrackDisplayElement(video).firstChild.firstChild.getBoundingClientRect(); |
| var ratio = multiLineRect.height / singleLineRect.height; |
| logResult(ratio > 2, "Second caption was more than twice as tall as first caption.") |
| endTest(); |
| } |
| |
| function testSingleLine() |
| { |
| singleLineRect = textTrackDisplayElement(video).firstChild.firstChild.getBoundingClientRect(); |
| consoleWrite("Single line caption height recorded."); |
| video.currentTime = 3; |
| } |
| |
| function loaded() |
| { |
| consoleWrite('Test that line breaks are forced in captions.'); |
| findMediaElement(); |
| waitForEvent('canplaythrough', testSingleLine); |
| waitForEvent('seeked', testUnbreakableLine); |
| video.src = findMediaFile('video', '../content/test'); |
| } |
| |
| </script> |
| </head> |
| <body onload="loaded()"> |
| <video controls > |
| <track src="captions-webvtt/long-word.vtt" kind="captions" default> |
| </video> |
| </body> |
| </html> |