Bug 1374333 - Use TalosContentProfiler to fix profiling in glvideo tests. r?rwood
MozReview-Commit-ID: EUNQG3Jhyp0
--- a/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html
+++ b/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html
@@ -1,44 +1,49 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<head>
<script src="chrome://talos-powers-content/content/TalosPowersContent.js"></script>
+<script type="text/javascript" src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
<script language="javascript" type="text/javascript">
const kTotalTicks = 100;
var start;
var gl = document.createElement("canvas").getContext("webgl");
gl.bindTexture(gl.TEXTURE_2D, gl.createTexture());
var video;
video = document.createElement("video");
video.src = "../../../video/clips/testsrc.1080p.60fps.mp4";
video.addEventListener("playing", playingListener, true); // loadstart?
video.loop = true;
function init() {
TalosPowersContent.focus(content_focused);
}
function content_focused() {
- video.play();
+ TalosContentProfiler.resume("glvideo start", true).then(() => {
+ video.play();
+ });
}
function playingListener() {
video.removeEventListener("playing", playingListener, true);
start = performance.now();
tick();
}
var tickCount = 0;
function tick() {
if (tickCount >= kTotalTicks) {
var elapsed = performance.now() - start;
- reportResult(elapsed, kTotalTicks);
+ TalosContentProfiler.pause("glvideo end", true).then(() => {
+ reportResult(elapsed, kTotalTicks);
+ });
return;
}
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
++tickCount;
window.setTimeout(tick, 0);
}