| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <video autoplay controls></video> | 2 <video autoplay controls></video> |
| 3 <script src=media-file.js></script> | 3 <script src=media-file.js></script> |
| 4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> | 5 (Please avoid writing new tests using video-test.js) --> |
| 6 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
| 7 <body> | 7 <body> |
| 8 <pre> | 8 <pre> |
| 9 Check if the autoplay gesture override experiment works. There are a lot | 9 Check if the autoplay gesture override experiment works. There are a lot |
| 10 of config options, so this test just runs all of them. | 10 of config options, so this test just runs all of them. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Also make sure that the page is visible again. Hidden pages cause the | 163 // Also make sure that the page is visible again. Hidden pages cause the |
| 164 // test to proceed very slowly. | 164 // test to proceed very slowly. |
| 165 testRunner.setPageVisibility("visible"); | 165 testRunner.setPageVisibility("visible"); |
| 166 | 166 |
| 167 queueNextExperiment(); | 167 queueNextExperiment(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 function runOneConfig(spec) | 170 function runOneConfig(spec) |
| 171 { | 171 { |
| 172 internals.settings.setAutoplayExperimentMode(spec.experimentType); | 172 internals.settings.setAutoplayExperimentMode(spec.experimentType); |
| 173 internals.settings.setViewportMetaEnabled(true); |
| 173 | 174 |
| 174 // Create, configure, and attach a media element. | 175 // Create, configure, and attach a media element. |
| 175 var element = document.createElement(spec.elementType); | 176 var element = document.createElement(spec.elementType); |
| 176 element.controls = true; | 177 element.controls = true; |
| 177 | 178 |
| 178 // Hide or show the page. | 179 // Hide or show the page. |
| 179 if (spec.visType == "obscured") | 180 if (spec.visType == "obscured") |
| 180 testRunner.setPageVisibility("hidden"); | 181 testRunner.setPageVisibility("hidden"); |
| 181 | 182 |
| 182 // Pick whether the element will be visible when canPlayThrough. | 183 // Pick whether the element will be visible when canPlayThrough. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 queueNextExperiment(); | 332 queueNextExperiment(); |
| 332 else | 333 else |
| 333 runOneConfig(spec); | 334 runOneConfig(spec); |
| 334 } | 335 } |
| 335 | 336 |
| 336 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); | 337 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); |
| 337 runNextConfig(); | 338 runNextConfig(); |
| 338 | 339 |
| 339 </script> | 340 </script> |
| 340 </html> | 341 </html> |
| OLD | NEW |