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

Unified Diff: third_party/WebKit/PerformanceTests/Canvas/draw-video-to-hw-accelerated-canvas-2d.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/draw-video-to-hw-accelerated-canvas-2d.html
diff --git a/third_party/WebKit/PerformanceTests/Canvas/draw-video-to-hw-accelerated-canvas-2d.html b/third_party/WebKit/PerformanceTests/Canvas/draw-video-to-hw-accelerated-canvas-2d.html
index 8498c37960e114795a3fd77e46391fa2852261f3..783a3d3700f764399dfdfb8ed3f7705cf22f5587 100644
--- a/third_party/WebKit/PerformanceTests/Canvas/draw-video-to-hw-accelerated-canvas-2d.html
+++ b/third_party/WebKit/PerformanceTests/Canvas/draw-video-to-hw-accelerated-canvas-2d.html
@@ -14,22 +14,6 @@ function setSize(width, height) {
destCanvas2D.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 drawing Video element to HW accelerated Canvas2D(1024x1024).",
@@ -53,7 +37,12 @@ window.onload = function () {
// but this API is not available in JS or WebPage. Assume the threshold size is 256x257
// and the dest canvas is HW accelerated Canvas when setting its size to 1024x1024.
setSize(1024, 1024);
- 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