Bug 1374333 - Use TalosContentProfiler to fix profiling in basic_compositor_video tests. r=rwood
authorMike Conley <mconley@mozilla.com>
Tue, 11 Jul 2017 18:16:17 -0400
changeset 418183 5e37209d792a42c062ad8d431231d01b06146990
parent 418182 6a3f9d54a1afc075e23d286c3ae520220b0e8f23
child 418184 fc35f3255fddc60da7dc7e0bbbce398cca27d88c
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrwood
bugs1374333
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1374333 - Use TalosContentProfiler to fix profiling in basic_compositor_video tests. r=rwood MozReview-Commit-ID: 9CzZC0C3Ty
testing/talos/talos/tests/video/video_playback.html
--- a/testing/talos/talos/tests/video/video_playback.html
+++ b/testing/talos/talos/tests/video/video_playback.html
@@ -1,14 +1,15 @@
 <!-- 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 src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 <script language="javascript" type="text/javascript">
 const MEASUREMENT1_MS = 3000;
 const MEASUREMENT2_MS = 2000;
 const PLAYBACK_RATE = 5;
 var vdo;
 var start1 = 0;
 var paintedFramesStart1 = 0;
 var start2 = 0;
@@ -70,48 +71,52 @@ function prepare() {
     readyToStart = true;
     vdo.setAttribute("width", vdo.videoWidth * viewMode[viewModeIndex]);
     vdo.setAttribute("height", vdo.videoHeight * viewMode[viewModeIndex]);
     startTest();
   }
 }
 
 function startTest() {
-  vdo.playbackRate = PLAYBACK_RATE;
-  start1 = performance.now();
-  paintedFramesStart1 = vdo.mozPaintedFrames;
-  vdo.play();
-  setTimeout(function() {
-    start2 = performance.now();
-    paintedFramesStart2 = vdo.mozPaintedFrames;
-    setTimeout(measurementEnded, MEASUREMENT2_MS);
-  }, MEASUREMENT1_MS);
+  TalosContentProfiler.resume("start test " + test[testIndex], true).then(() => {
+    vdo.playbackRate = PLAYBACK_RATE;
+    start1 = performance.now();
+    paintedFramesStart1 = vdo.mozPaintedFrames;
+    vdo.play();
+    setTimeout(function() {
+      start2 = performance.now();
+      paintedFramesStart2 = vdo.mozPaintedFrames;
+      setTimeout(measurementEnded, MEASUREMENT2_MS);
+    }, MEASUREMENT1_MS);
+  });
 }
 
 function measurementEnded() {
   vdo.pause();
   var end = performance.now();
   var paintedFramesEnd = vdo.mozPaintedFrames;
   var timePerFrame1 = (start2 - start1) / (paintedFramesStart2 - paintedFramesStart1);
   var timePerFrame2 = (end - start2) / (paintedFramesEnd - paintedFramesStart2);
   testResult.names.push(test[testIndex] + "_scale_" + viewMode[viewModeIndex] + "_startup");
   testResult.values.push(timePerFrame1);
   testResult.names.push(test[testIndex] + "_scale_" + viewMode[viewModeIndex] + "_inclip");
   testResult.values.push(timePerFrame2);
 
-  if (viewMode[viewModeIndex] == "fullscreen") {
-    // Exit fullscreen mode
-    if (document.exitFullscreen) {
-      document.exitFullscreen();
-    } else if (document.mozCancelFullScreen) {
-      document.mozCancelFullScreen();
+  TalosContentProfiler.pause("done test" + test[testIndex], true).then(() => {
+    if (viewMode[viewModeIndex] == "fullscreen") {
+      // Exit fullscreen mode
+      if (document.exitFullscreen) {
+        document.exitFullscreen();
+      } else if (document.mozCancelFullScreen) {
+        document.mozCancelFullScreen();
+      }
+    } else {
+      nextTest();
     }
-  } else {
-    nextTest();
-  }
+  });
 }
 
 function nextTest() {
   viewModeIndex++;
   if (viewModeIndex >= viewMode.length) {
     viewModeIndex = 0;
     testIndex++;
   }