Bug 1374333 - Use TalosContentProfiler to fix profiling in dromaeo tests. r=rwood
authorMike Conley <mconley@mozilla.com>
Thu, 13 Jul 2017 18:24:42 -0400
changeset 418188 02dac72b6dd059a858fea4320fe610db6acbd8b7
parent 418187 ba3597e894b0eefb4a58d5b64928b65ad3b94d86
child 418189 c9fc3cee23936687c84a9cc4120fe05c5fe972cf
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 dromaeo tests. r=rwood MozReview-Commit-ID: 8EAESTvLnVP
testing/talos/talos/tests/dromaeo/cssquery-dojo.html
testing/talos/talos/tests/dromaeo/cssquery-ext.html
testing/talos/talos/tests/dromaeo/cssquery-jquery.html
testing/talos/talos/tests/dromaeo/cssquery-mootools.html
testing/talos/talos/tests/dromaeo/cssquery-prototype.html
testing/talos/talos/tests/dromaeo/cssquery-yui.html
testing/talos/talos/tests/dromaeo/dom-attr.html
testing/talos/talos/tests/dromaeo/dom-modify.html
testing/talos/talos/tests/dromaeo/dom-query.html
testing/talos/talos/tests/dromaeo/dom-traverse.html
testing/talos/talos/tests/dromaeo/index.html
testing/talos/talos/tests/dromaeo/webrunner.js
--- a/testing/talos/talos/tests/dromaeo/cssquery-dojo.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-dojo.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/cssquery-ext.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-ext.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/cssquery-jquery.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-jquery.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/cssquery-mootools.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-mootools.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/cssquery-prototype.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-prototype.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/cssquery-yui.html
+++ b/testing/talos/talos/tests/dromaeo/cssquery-yui.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/dom-attr.html
+++ b/testing/talos/talos/tests/dromaeo/dom-attr.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/dom-modify.html
+++ b/testing/talos/talos/tests/dromaeo/dom-modify.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/dom-query.html
+++ b/testing/talos/talos/tests/dromaeo/dom-query.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/dom-traverse.html
+++ b/testing/talos/talos/tests/dromaeo/dom-traverse.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/index.html
+++ b/testing/talos/talos/tests/dromaeo/index.html
@@ -7,17 +7,17 @@
   <!--[if lt IE 7.]>
   <link href="ie.css" rel="stylesheet" type="text/css" />
   <script defer type="text/javascript" src="pngfix.js"></script>
   <![endif]-->
   <link href="application.css" rel="stylesheet" type="text/css" />
   <script src="jquery.js"></script>
   <script src="json.js"></script>
   <script src="webrunner.js"></script>
-  <script src="../../scripts/Profiler.js"></script>
+  <script src="chrome://talos-powers-content/content/TalosContentProfiler.js"></script>
 </head>
 <body>
         <div id="top" >
           <div id="logo">
             <a href="./"><img src="images/logo3.png" class="png"/></a>
           </div>
           <img src="images/dino1.png" class="dino1 png"/>
           <img src="images/left.png" class="left png"/>
--- a/testing/talos/talos/tests/dromaeo/webrunner.js
+++ b/testing/talos/talos/tests/dromaeo/webrunner.js
@@ -73,84 +73,90 @@
 			num = 1;
 		}
 
 		time += timePerTest * numTests;
 
 		testNum[curID]++;
 
 		// Don't execute the test immediately
-		queues[testID].push(function(){
+		queues[testID].push(function() {
 			title = name;
 			var times = [], start, pos = 0, cur;
-			
-			setTimeout(function(){
+
+			setTimeout(function() {
 				// run tests
 				try {
-					if ( doShark(name) ) {
+					if (doShark(name)) {
 						connectShark();
 						startShark();
 					}
-					
-					Profiler.resume();
+				} catch( e ) {
+					alert("FAIL " + name + " " + num + e);
+					return;
+				}
+
+				TalosContentProfiler.resume(name, true).then(() => {
 					start = performance.now();
-					
-					if ( runStyle === "runs/s" ) {
+
+					if (runStyle === "runs/s") {
 						var runs = 0;
-						
+
 						cur = performance.now();
-						
+
 						while ( (cur - start) < 1000 ) {
 							fn();
 							cur = performance.now();
 							runs++;
 						}
 					} else {
 						fn();
 						cur = performance.now();
 					}
 
-					if ( doShark(name) ) {
-						stopShark();
-						disconnectShark();
-					}
-					Profiler.pause();
-					
-					// For making Median and Variance
-					if ( runStyle === "runs/s" ) {
-						times.push( (runs * 1000) / (cur - start) );
-					} else {
-						times.push( cur - start );
-					}
-				} catch( e ) {
-					alert("FAIL " + name + " " + num + e);
-					return;
-				}
+					try {
+					  if (doShark(name)) {
+							stopShark();
+							disconnectShark();
+						}
+				  } catch(e) {
+						alert("FAIL " + name + " " + num + e);
+						return;
+				  }
+
+					TalosContentProfiler.pause(name, true).then(() => {
+						// For making Median and Variance
+						if (runStyle === "runs/s") {
+							times.push((runs * 1000) / (cur - start));
+						} else {
+							times.push(cur - start);
+						}
 
-				if ( pos < numTests ) {
-					updateTime();
-					updateTestPos({curID: curID, collection: testNames[curID], version: testVersions[curID]});
-				}
+				    if (pos < numTests) {
+							updateTime();
+							updateTestPos({curID: curID, collection: testNames[curID], version: testVersions[curID]});
+						}
 
-				if ( ++pos < numTests ) {
-					setTimeout( arguments.callee, 1 );
-				
-				} else {
-					var data = compute( times, numTests );
+				    if (++pos < numTests) {
+							setTimeout(arguments.callee, 1);
+						} else {
+							var data = compute(times, numTests);
 
-					data.curID = curID;
-					data.collection = testNames[curID];
-					data.version = testVersions[curID];
-					data.name = title;
-					data.scale = num;
-								
-					logTest(data);
-			
-					dequeue();
-				}
+							data.curID = curID;
+							data.collection = testNames[curID];
+							data.version = testVersions[curID];
+							data.name = title;
+							data.scale = num;
+
+							logTest(data);
+
+							dequeue();
+						}
+					});
+				});
 			}, 1);
 		});
 
 		function compute(times, runs){
 			var results = {runs: runs}, num = times.length;
 
 			times = times.sort(function(a,b){
 				return a - b;