| <!DOCTYPE html><!-- webkit-test-runner [ CaptionDisplaySettingsEnabled=true ] --> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <title>caption-display-settings-positionArea</title> |
| <script src="../video-test.js"></script> |
| <script> |
| async function runTest() { |
| findMediaElement(); |
| |
| if (!window.internals) |
| return; |
| |
| window.options = null; |
| internals.setMockCaptionDisplaySettingsClientCallback(async (element, inOptions) => { |
| options = inOptions; |
| }); |
| |
| let runPositionTest = async (positionArea, xPositionAreaExpected, yPositionAreaExpected) => { |
| consoleWrite(''); |
| await run(`video.showCaptionDisplaySettings({positionArea: "${ positionArea }"})`); |
| testExpected('options.xPositionArea', xPositionAreaExpected); |
| testExpected('options.yPositionArea', yPositionAreaExpected); |
| } |
| |
| await runPositionTest('top left', 'Left', 'Top'); |
| await runPositionTest('left top', 'Left', 'Top'); |
| await runPositionTest('top center', 'Center', 'Top'); |
| await runPositionTest('top right', 'Right', 'Top'); |
| await runPositionTest('top x-start', 'Left', 'Top'); |
| await runPositionTest('top x-end', 'Right', 'Top'); |
| await runPositionTest('center center', 'Center', 'Center'); |
| await runPositionTest('bottom left', 'Left', 'Bottom'); |
| await runPositionTest('left bottom', 'Left', 'Bottom'); |
| await runPositionTest('bottom center', 'Center', 'Bottom'); |
| await runPositionTest('bottom right', 'Right', 'Bottom'); |
| await runPositionTest('bottom x-start', 'Left', 'Bottom'); |
| await runPositionTest('bottom x-end', 'Right', 'Bottom'); |
| } |
| |
| window.addEventListener('load', event => { |
| requestAnimationFrame(() => { |
| runTest().then(endTest).catch(failTest); |
| }); |
| }); |
| </script> |
| </head> |
| <body> |
| <video muted autoplay></video> |
| </body> |
| </html> |