Bug 1374333 - Use TalosContentProfiler to fix profiling in tcanvasmark tests. r?rwood
MozReview-Commit-ID: AWGSqVeOaB6
--- a/testing/talos/talos/tests/canvasmark/index.html
+++ b/testing/talos/talos/tests/canvasmark/index.html
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>CanvasMark 2013 - HTML5 Canvas 2D Rendering and JavaScript Benchmark</title>
- <script src="../../scripts/Profiler.js"></script>
+ <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
<script src="scripts/mathlib-min.js"></script>
<script src="scripts/k3d-min.js"></script>
<script src="scripts/canvasmark_v6.js"></script>
<script async defer src="scripts/jquery-1.4.2.min.js"></script>
<style type="text/css">
@font-face
{
font-family: HelveticaNeue;
--- a/testing/talos/talos/tests/canvasmark/scripts/canvasmark_v6.js
+++ b/testing/talos/talos/tests/canvasmark/scripts/canvasmark_v6.js
@@ -371,17 +371,16 @@ window.requestAnimFrame = (function()
isPlayable: function isPlayable()
{
return this.playable;
},
_onInitScene: function _onInitScene()
{
this.sceneGlitchCount = this.testScore = this.testState = 0;
- Profiler.resume(this.interval && this.interval.label);
this.sceneStartTime = Date.now();
this.sceneCompletedTime = null;
},
onInitScene: function onInitScene()
{
if (this.interval !== null)
{
@@ -410,17 +409,16 @@ window.requestAnimFrame = (function()
// too many FPS glitches! so benchmark scene completed (allow to run visually for a few seconds)
this.sceneCompletedTime = Date.now();
var score = ~~(((this.sceneCompletedTime - this.sceneStartTime) * this.testScore) / 100);
GameHandler.benchmarkScoreCount += score;
GameHandler.benchmarkScores.push(score);
var name = this.interval.label.replace(/Test [0-9] - /g, "");
name = name.replace(/, /g, "- ");
GameHandler.benchmarkLabels.push(name);
- Profiler.pause(this.interval.label);
if (typeof console !== "undefined")
{
console.log(score + " [" + this.interval.label + "]");
}
}
}
}
return false;
@@ -6130,17 +6128,19 @@ if (typeof Benchmark == "undefined" || !
this.featureTest = new Feature.Test(this, loader);
// add benchmark completed scene
this.scenes.push(new Benchmark.CompletedScene(this));
// the benchmark info scene is displayed first and responsible for allowing the
// benchmark to start once images required by the game engines have been loaded
loader.onLoadCallback(function() {
- infoScene.ready();
+ TalosContentProfiler.resume("begin", true).then(() => {
+ infoScene.ready();
+ });
});
};
extend(Benchmark.Main, Game.Main,
{
asteroidsTest: null,
arenaTest: null,
featureTest: null,