performance-report-comparison.js revision ae090ac5cdb5a6367975f3eae3acdc77433f08dc
// -- Shorthand and Private Variables ------------------------------------------
Obj = Y.Object,
CONTENT_BOX = 'contentBox',
PERFORMANCE = 'performance';
function Comparison() {
}
// -- Protected Properties -------------------------------------------------
// Mapping of group names to ids.
_groupNameIdMap: {},
// Mapping of test names to ids.
_testNameIdMap: {},
// -- Public Constants -----------------------------------------------------
// Selectors (relative to contentBox)
SELECTOR_HEADER_GROUP: 'thead>tr>th.group',
SELECTOR_RESULT : 'tbody>tr.result',
SELECTOR_RESULT_GROUP: 'tbody>tr.result>td.group',
// Templates
'<thead>' +
'<tr>' +
'<th class="test">Test</th>' +
// Group-specific header columns will be appended here
'</tr>' +
'</thead>',
HEADER_GROUP_TEMPLATE: '<th class="group">{name}</th>',
'<tr id="{id}" class="result">' +
'<td class="test">{name}</td>' +
// Group-specific result columns will be appended here.
'</tr>',
RESULT_GROUP_TEMPLATE: '<td class="group empty groupId-{id}"> </td>',
RESULT_GROUP_CONTENT_TEMPLATE: '<span class="median">{median}</span> <span class="mediandev">{mediandev}</span>',
// -- Public Methods -------------------------------------------------------
_clearBody: function () {
this._groupNameIdMap = {};
this._testNameIdMap = {};
});
},
_clearHeader: function () {
});
},
_clearResults: function () {
});
},
if (body) {
this._clearBody();
} else {
// Render a new body.
}
if (suite) {
// This loop also populate the _groupNameIdMap and _testNameIdMap
// properties.
continue;
}
if (!this._groupNameIdMap[groupName]) {
}
this._testNameIdMap[testName]) {
continue;
}
// Test name is unique; add it.
}
}
// Append test names to the body, with placeholder columns for
// groups.
this.RESULT_TEMPLATE,
));
this.RESULT_GROUP_TEMPLATE,
));
}, this);
}, this);
}
},
tr;
if (head) {
this._clearHeader();
} else {
// Render a new header.
}
if (suite) {
// Append group names to the header.
this.HEADER_GROUP_TEMPLATE,
));
}, this);
}
},
if (!resultNode || !groupNode) {
return;
}
if (resultData.failures) {
} else {
{
}
));
}
},
// -- Protected Event Handlers ---------------------------------------------
_afterStart: function (e) {
},
_onResultClick: function (e) {
// e.currentTarget.next('tr.code').toggleClass('hidden');
}
}, {
// -- Public Static Constants ----------------------------------------------
NAME: 'comparisonReport',
ATTRS: {}
});
}, '@VERSION@', {
requires: ['performance-report']
});