Bug 1374333 - Make pageloader start and capture profiles at better times. r?rwood
Before, we were doing capture after moving from page to page, but keeping the cycles all
within the same profile.
This change causes us to capture separate profiles for each page load, regardless of whether
or not they're just another cycle for a particular page.
This is particularly useful for tests like tps which use the pageloader to load a single test
URL over multiple cycles.
MozReview-Commit-ID: 5u0jxC4P75q
--- a/testing/talos/talos/pageloader/chrome/pageloader.js
+++ b/testing/talos/talos/pageloader/chrome/pageloader.js
@@ -321,16 +321,20 @@ var ContentListener = {
return undefined;
},
};
// load the current page, start timing
var removeLastAddedListener = null;
var removeLastAddedMsgListener = null;
function plLoadPage() {
+ if (profilingInfo) {
+ TalosParentProfiler.beginTest(getCurrentPageShortName() + "_pagecycle_" + pageCycle);
+ }
+
var pageName = pages[pageIndex].url.spec;
if (removeLastAddedListener) {
removeLastAddedListener();
removeLastAddedListener = null;
}
if (removeLastAddedMsgListener) {
@@ -449,33 +453,29 @@ function loadFail() {
// TODO: consider adding a tab and removing the old tab?!?
setTimeout(plLoadPage, delay);
}
}
var plNextPage = async function() {
var doNextPage = false;
+
+ if (profilingInfo) {
+ await TalosParentProfiler.finishTest();
+ }
+
if (pageCycle < numPageCycles) {
pageCycle++;
doNextPage = true;
- } else {
- if (profilingInfo) {
- await TalosParentProfiler.finishTest();
- }
-
- if (pageIndex < pages.length - 1) {
- pageIndex++;
- if (profilingInfo) {
- TalosParentProfiler.beginTest(getCurrentPageShortName());
- }
- recordedName = null;
- pageCycle = 1;
- doNextPage = true;
- }
+ } else if (pageIndex < pages.length - 1) {
+ pageIndex++;
+ recordedName = null;
+ pageCycle = 1;
+ doNextPage = true;
}
if (doNextPage == true) {
if (forceCC) {
var tccstart = new Date();
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.garbageCollect();