Bug 1374333 - Use TalosContentProfiler for profiling in tsvgx tests. r=rwood
authorMike Conley <mconley@mozilla.com>
Fri, 16 Jun 2017 18:09:45 -0400
changeset 418175 aae4e051c61e6a0a201f35dc53e872f92448be96
parent 418174 e0c5dbd138a3f40413d8b995fc7771d82853ebde
child 418176 72e2133c617f81eb0fda677fd544103c45809fd4
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 for profiling in tsvgx tests. r=rwood MozReview-Commit-ID: 9auT5RxW2lh
testing/talos/talos/tests/svgx/hixie-001.xml
testing/talos/talos/tests/svgx/hixie-002.xml
testing/talos/talos/tests/svgx/hixie-003.xml
testing/talos/talos/tests/svgx/hixie-004.xml
testing/talos/talos/tests/svgx/hixie-005.xml
testing/talos/talos/tests/svgx/hixie-006.xml
testing/talos/talos/tests/svgx/hixie-007.xml
--- a/testing/talos/talos/tests/svgx/hixie-001.xml
+++ b/testing/talos/talos/tests/svgx/hixie-001.xml
@@ -282,11 +282,26 @@ a circle that only has a fill animates o
    } else {
      var end = new Date();
      var elapsed = (end - start) / 1000;
      t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
      if (window.tpRecordTime) window.tpRecordTime(end - start, start);
      if (parent.reportResults) parent.reportResults(end - start, start);
    }
   }
-  addEventListener("load", function(){ rAF(bounce); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-001.xml loaded", true).then(() => {
+      rAF(bounce);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-002.xml
+++ b/testing/talos/talos/tests/svgx/hixie-002.xml
@@ -284,11 +284,27 @@ changes to its "cx" and "cy" attributes.
    } else {
      var end = new Date();
      var elapsed = (end - start) / 1000;
      t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
      if (window.tpRecordTime) window.tpRecordTime(end - start, start);
      if (parent.reportResults) parent.reportResults(end - start, start);
    }
   }
-  addEventListener("load", function(){ rAF(bounce); });
+
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-002.xml loaded", true).then(() => {
+      rAF(bounce);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-003.xml
+++ b/testing/talos/talos/tests/svgx/hixie-003.xml
@@ -70,11 +70,26 @@ removed from the document.
     } else {
       var end = new Date();
       var elapsed = (end - start) / 1000;
       t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
       if (window.tpRecordTime) window.tpRecordTime(end - start, start);
       if (parent.reportResults) parent.reportResults(end - start, start);
     }
   }
-  addEventListener("load", function(){ rAF(runTest); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-003.xml loaded", true).then(() => {
+      rAF(runTest);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-004.xml
+++ b/testing/talos/talos/tests/svgx/hixie-004.xml
@@ -71,11 +71,26 @@ removed from the document.
     } else {
       var end = new Date();
       var elapsed = (end - start) / 1000;
       t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
       if (window.tpRecordTime) window.tpRecordTime(end - start, start);
       if (parent.reportResults) parent.reportResults(end - start, start);
     }
   }
-  addEventListener("load", function(){ rAF(runTest); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-004.xml loaded", true).then(() => {
+      rAF(runTest);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-005.xml
+++ b/testing/talos/talos/tests/svgx/hixie-005.xml
@@ -77,11 +77,26 @@ the previous batches are not removed fro
     } else {
       var end = new Date();
       var elapsed = (end - start) / 1000;
       t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
       if (window.tpRecordTime) window.tpRecordTime(end - start, start);
       if (parent.reportResults) parent.reportResults(end - start, start);
     }
   }
-  addEventListener("load", function(){ rAF(runTest); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-005.xml loaded", true).then(() => {
+      rAF(runTest);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-006.xml
+++ b/testing/talos/talos/tests/svgx/hixie-006.xml
@@ -77,11 +77,26 @@ the previous batches are not removed fro
     } else {
       var end = new Date();
       var elapsed = (end - start) / 1000;
       t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.';
       if (window.tpRecordTime) window.tpRecordTime(end - start, start);
       if (parent.reportResults) parent.reportResults(end - start, start);
     }
   }
-  addEventListener("load", function(){ rAF(runTest); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-006.xml loaded", true).then(() => {
+      rAF(runTest);
+    });
+  });
  ]]></script>
 </svg>
--- a/testing/talos/talos/tests/svgx/hixie-007.xml
+++ b/testing/talos/talos/tests/svgx/hixie-007.xml
@@ -269,11 +269,26 @@ contains many 'path' elements with fill 
     } else {
       var end = new Date();
       var elapsed = (end - start) / 1000;
       t.firstChild.data = 'Result: ' + elapsed.toFixed(2) + 's';
       if (window.tpRecordTime) window.tpRecordTime(end - start, start);
       if (parent.reportResults) parent.reportResults(end - start, start);
     }
   }
-  addEventListener("load", function(){ rAF(runTest); });
+  addEventListener("load", function() {
+    try {
+      // Outside of talos, this throws a security exception which no-op this file.
+      // (It's not required nor allowed for addons since Firefox 17)
+      // It's used inside talos from non-privileged pages (like during tscroll),
+      // and it works because talos disables all/most security measures.
+      netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+    } catch (e) {}
+
+    Components.utils.import("resource://gre/modules/Services.jsm");
+    Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
+
+    TalosContentProfiler.resume("hixie-007.xml loaded", true).then(() => {
+      rAF(runTest);
+    });
+  });
  ]]></script>
 </svg>