Bug 1374333 - Use TalosContentProfiler to fix profiling in tcanvasmark tests. r?rwood draft
authorMike Conley <mconley@mozilla.com>
Tue, 11 Jul 2017 18:05:24 -0400
changeset 610835 d7ceacfc4479ea2b50a4dab44cdc63ee1af64e0c
parent 610834 f316d6d6cec3689cc1c3240cac2aae9b3372f945
child 610836 bfd72337099af269e8c43136bb3787cd9b45688f
push id69002
push usermconley@mozilla.com
push dateTue, 18 Jul 2017 19:11:35 +0000
reviewersrwood
bugs1374333
milestone56.0a1
Bug 1374333 - Use TalosContentProfiler to fix profiling in tcanvasmark tests. r?rwood MozReview-Commit-ID: AWGSqVeOaB6
testing/talos/talos/tests/canvasmark/index.html
testing/talos/talos/tests/canvasmark/scripts/canvasmark_v6.js
--- 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,