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

Unified Diff: third_party/WebKit/PerformanceTests/Canvas/upload-video-to-sub-texture.html

Issue 1644353002: Enable blink_perf.canvas on Android Perf bots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add --reduce-security-for-testing Created 4 years, 10 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/PerformanceTests/Canvas/upload-video-to-sub-texture.html
diff --git a/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-sub-texture.html b/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-sub-texture.html
index eb79c7dc4d850016439981a4644ed1c793fa2cf6..80d3e08fa21e3075fd46480b8ffd638f834e8a85 100644
--- a/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-sub-texture.html
+++ b/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-sub-texture.html
@@ -9,30 +9,13 @@ var videoElement = document.getElementById("video");
var canvas3D = document.createElement('canvas');
var gl = canvas3D.getContext('webgl');
if(!gl)
- CanvasRunner.logFatalError("\nWebGL is not supported or enabled on this platform!\n");
+ CanvasRunner.logFatalError("WebGL is not supported or enabled on this platform!");
function setSize(width, height) {
canvas3D.width = width;
canvas3D.height = height;
}
-function addPlayCallback(videoElement) {
- // This logic makes sure this perf test starts after playing the video.
- videoElement.addEventListener("canplaythrough", startVideo, true);
- videoElement.addEventListener("play", startPerfTest, true);
- videoElement.addEventListener('error', function(ev) {
- CanvasRunner.logFatalError("\nmp4 codec is not supported on this platform. Received error event:" + ev.target.error.code + "\n");
- }, false);
- videoElement.src = "../resources/bear-1280x720.mp4";
-}
-
-function startVideo() {
- // loop can emit this event again.
- videoElement.removeEventListener("canplaythrough", startVideo, true);
- videoElement.play();
-}
-
-
function startPerfTest() {
CanvasRunner.start({
description: "This bench test checks the speed on texSubImage2D(Video) on Webgl.",
@@ -74,7 +57,12 @@ function postRun() {
window.onload = function () {
setSize(1, 1);
- addPlayCallback(videoElement);
+
+ videoElement.src = "resources/bear-1280x720.mp4";
+ if(!videoElement.canPlayType('video/mp4').replace(/no/, '')) {
+ CanvasRunner.logFatalError("video/mp4 is unsupported");
+ };
+ CanvasRunner.startPlayingAndWaitForVideo(videoElement, startPerfTest);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698