mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1518999 - Refactor some performance.getEntries related tests r=mstange
Some tests made some assumptions about the number of returned entries by performance.getEntries, and these assumptions are not valid anymore once we added new entries. Depends on D66463 Differential Revision: https://phabricator.services.mozilla.com/D68645
This commit is contained in:
parent
d914187ce2
commit
f59ae11633
@ -192,13 +192,20 @@ add_task(async function runRTPTests() {
|
||||
content.performance.measure("Test-Measure", "Test", "Test-End");
|
||||
|
||||
// Check the entries for performance.getEntries/getEntriesByType/getEntriesByName.
|
||||
await new Promise(resolve => {
|
||||
const paintObserver = new content.PerformanceObserver(() => {
|
||||
resolve();
|
||||
});
|
||||
paintObserver.observe({ type: "paint", buffered: true });
|
||||
});
|
||||
|
||||
is(
|
||||
content.performance.getEntries().length,
|
||||
4,
|
||||
5,
|
||||
"For reduceTimerPrecision, there should be 4 entries for performance.getEntries()"
|
||||
// PerformanceNavigationTiming, PerformanceMark, PerformanceMark, PerformanceMeasure
|
||||
// PerformancePaintTiming, PerformanceNavigationTiming, PerformanceMark, PerformanceMark, PerformanceMeasure
|
||||
);
|
||||
for (var i = 0; i < 4; i++) {
|
||||
for (var i = 0; i < 5; i++) {
|
||||
let startTime = content.performance.getEntries()[i].startTime;
|
||||
let duration = content.performance.getEntries()[i].duration;
|
||||
ok(
|
||||
|
@ -407,7 +407,9 @@ add_task(async function() {
|
||||
tests.forEach(test => {
|
||||
let { input, headers } = test;
|
||||
if (input === "PERFORMANCE_ENTRIES") {
|
||||
input = content.wrappedJSObject.performance.getEntries();
|
||||
input = content.wrappedJSObject.performance.getEntriesByType(
|
||||
"navigation"
|
||||
);
|
||||
}
|
||||
content.wrappedJSObject.doConsoleTable(input, headers);
|
||||
});
|
||||
|
@ -144,9 +144,8 @@ var allResources = {
|
||||
};
|
||||
|
||||
window.onload = function() {
|
||||
let entries = performance.getEntries();
|
||||
// The entries.slice() to drop first 'document' item.
|
||||
for (let entry of entries.slice(1)) {
|
||||
let entries = performance.getEntriesByType('resource');
|
||||
for (let entry of entries) {
|
||||
//dump(entry.name + " || "+ entry.initiatorType+ "\n");
|
||||
if (!(entry.name in allResources)) {
|
||||
if (entry.name.substr(-4) == ".ttf") {
|
||||
|
Loading…
Reference in New Issue
Block a user