Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html |
| index edf742f1954cd537edad87c611e0507fac722bf0..88d6d974fab6da577262532befcedc1b78224969 100644 |
| --- a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html |
| +++ b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html |
| @@ -40,6 +40,9 @@ |
| it is ready to play. |
| offscreen - element starts out offscreen and stays offscreen. |
| obscured - onscreen but page is not visible. |
| + Setting - autoplay settings value |
| + enabled - content settings enables autoplay |
| + disabled - content settings disables autoplay |
| == Test Outputs == |
| Early? - did playback start before element was scrolled onscreen? For |
| @@ -58,6 +61,7 @@ |
| <td>Mute</td> |
| <td>Mobile</td> |
| <td>View</td> |
| +<td>Setting</td> |
| <td>Early?</td> |
| <td>Played?</td> |
| <td>Muted?</td> |
| @@ -95,7 +99,6 @@ function becomeOptimizedForMobile(enable) |
| if (!enable) { |
| // We can't transition out of optimized for mobile. |
| - console.log("becomeOptimizedForMobile: test is broken -- cannot un-enable mobile"); |
| endTest(); |
| } else { |
| // This only works once. |
| @@ -130,7 +133,7 @@ function addResultsRow(spec) |
| // Add remaining fields. |
| var fields = [ "elementType", "autoplayType", "mutedType", "mobileType", |
| - "visType", "playedEarly", "played", "muted"]; |
| + "visType", "settingValue", "playedEarly", "played", "muted"]; |
| for(idx in fields) |
| row.insertCell().innerText = spec[fields[idx]].substring(0,7); |
| } |
| @@ -171,6 +174,7 @@ function runOneConfig(spec) |
| { |
| internals.settings.setAutoplayExperimentMode(spec.experimentType); |
| internals.settings.setViewportMetaEnabled(true); |
| + testRunner.setAutoplayAllowed(spec.settingValue == "enabled"); |
| // Create, configure, and attach a media element. |
| var element = document.createElement(spec.elementType); |
| @@ -248,6 +252,7 @@ var mutedTypes = ["no", "yes"]; |
| var visTypes = ["onscreen", "scroll", "offscreen", "obscured"]; |
| // mobileTypes must always start with no, since we cannot un-optimize the page. |
| var mobileTypes = ["no", "yes"]; |
| +var autoplaySettings = ["enabled", "disabled"]; |
| function runNextConfig() |
| { |
| @@ -266,11 +271,14 @@ function runNextConfig() |
| exp = Math.floor(exp / mutedTypes.length); |
| spec.visType = visTypes[exp % visTypes.length]; |
| exp = Math.floor(exp / visTypes.length); |
| + spec.settingValue = autoplaySettings[exp % autoplaySettings.length]; |
|
liberato (no reviews please)
2016/04/29 14:41:43
might want to restrict the cases that this covers
|
| + exp = Math.floor(exp / autoplaySettings.length); |
| // Mobile must always change last, so that all the "no" cases precede |
| // all the "yes" cases, since we can't switch the doc back to "not |
| // optimized for mobile". |
| spec.mobileType = mobileTypes[exp % mobileTypes.length]; |
| exp = Math.floor(exp / mobileTypes.length); |
| + |
| spec.experimentNumber = configNumber; |
| // Return null if configNumber was larger than the highest experiment. |