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

Unified Diff: third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html

Issue 1920863005: Disable autoplay experiments if the autoplay content settings is set to block. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay-ifsameorigin-ormuted
Patch Set: rebase with tests Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698