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

Unified Diff: third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js

Issue 2133383002: Remove video-test.js dependency from [audio, video]-autoplay-* tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js b/third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js
index 183e2f11ad54822906f51136d95e567c4b4322c3..f3feb89d77ad7379907563e187bdb42040210eb9 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js
+++ b/third_party/WebKit/LayoutTests/media/autoplay-experiment-helper.js
@@ -26,7 +26,7 @@ function becomeOptimizedForMobile(enable)
if (!enable) {
// We can't transition out of optimized for mobile.
- endTest();
+ testRunner.notifyDone();
} else {
// This only works once.
mobileMetaTag = document.createElement('meta');
@@ -130,7 +130,7 @@ function runOneConfig(spec)
// Record the spec in the element, so that we can display the
// results later.
element.spec = spec;
- window.internals.triggerAutoplayViewportCheck(element);
+ internals.triggerAutoplayViewportCheck(element);
// Wait for canplaythrough before continuing, so that the media
// might actually be playing.
@@ -148,7 +148,7 @@ function runOneConfig(spec)
// We are supposed to scroll the player into view.
element.scrollIntoView(true);
// TODO(liberato): remove once autoplay gesture override experiment concludes.
- window.internals.triggerAutoplayViewportCheck(element);
+ internals.triggerAutoplayViewportCheck(element);
// Once these two methods return, changes to the element state due
// to the autoplay experiment should be observable synchronously.
checkElementStatus(element, spec);
@@ -200,7 +200,7 @@ function runNextConfig()
// Return null if configNumber was larger than the highest experiment.
if (exp > 0)
- endTest();
+ testRunner.notifyDone();
configNumber++;
@@ -263,9 +263,11 @@ function runNextConfig()
}
function start(mediaType, experiments) {
- elementTypes = [ mediaType ];
- experimentTypes = experiments;
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ elementTypes = [ mediaType ];
+ experimentTypes = experiments;
- window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
- runNextConfig();
+ internals.settings.setMediaPlaybackRequiresUserGesture(true);
+ runNextConfig();
}

Powered by Google App Engine
This is Rietveld 408576698