Bug 1374333 - Use TalosContentProfiler for profiling in tsvgx tests. r?rwood
MozReview-Commit-ID: 9auT5RxW2lh
--- 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>