mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-04 02:51:19 +08:00
Enable trace timeout tests rule and fix issues
Bug: none Change-Id: I697795901d5bfc98578cc5a7f8c316ec1783184f No-Tree-Checks: True Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4724982 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Andres Olivares <andoli@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
952e9509e2
commit
a95ded3cd8
@@ -18,6 +18,7 @@ module.exports = {
|
||||
'rulesdir/no_repeated_tests' : 2,
|
||||
'rulesdir/compare_arrays_with_assert_deepequal' : 2,
|
||||
'rulesdir/ban_screenshot_test_outside_perf_panel' : 2,
|
||||
'rulesdir/trace_engine_test_timeouts' : 2,
|
||||
},
|
||||
'overrides' : [{
|
||||
'files' : ['*.ts'],
|
||||
|
||||
@@ -28,7 +28,7 @@ describeWithMockConnection('TraceSDKServices', function() {
|
||||
});
|
||||
|
||||
describe('DOMNodeLookup', function() {
|
||||
it('returns the DOM Node for the given node ID', async () => {
|
||||
it('returns the DOM Node for the given node ID', async function() {
|
||||
// Create a mock target, dom model, document and node.
|
||||
const target = createTarget();
|
||||
const domModel = target.model(SDK.DOMModel.DOMModel);
|
||||
|
||||
@@ -8,13 +8,13 @@ import {TraceLoader} from '../../../helpers/TraceLoader.js';
|
||||
const {assert} = chai;
|
||||
|
||||
describe('FilmStrip', function() {
|
||||
it('identifies the frames from a trace', async () => {
|
||||
it('identifies the frames from a trace', async function() {
|
||||
const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
assert.lengthOf(filmStrip.frames, 5);
|
||||
});
|
||||
|
||||
it('caches the film strip based on the trace data and the zero time', async () => {
|
||||
it('caches the film strip based on the trace data and the zero time', async function() {
|
||||
const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const filmStrip1 = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
const filmStrip2 = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
@@ -29,7 +29,7 @@ describe('FilmStrip', function() {
|
||||
assert.notStrictEqual(filmStrip3, filmStrip4);
|
||||
});
|
||||
|
||||
it('exposes the snapshot string for each frame', async () => {
|
||||
it('exposes the snapshot string for each frame', async function() {
|
||||
const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
assert.isTrue(filmStrip.frames.every(frame => {
|
||||
@@ -37,7 +37,7 @@ describe('FilmStrip', function() {
|
||||
}));
|
||||
});
|
||||
|
||||
it('can use a custom zero time to filter out screenshots', async () => {
|
||||
it('can use a custom zero time to filter out screenshots', async function() {
|
||||
const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
// Set a custom zero time after the first screenshot and ensure that we now only have four events.
|
||||
@@ -52,7 +52,7 @@ describe('FilmStrip', function() {
|
||||
]);
|
||||
});
|
||||
|
||||
it('can return the frame closest to a given timestamp', async () => {
|
||||
it('can return the frame closest to a given timestamp', async function() {
|
||||
const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);
|
||||
const frameTimestamps = filmStrip.frames.map(frame => frame.screenshotEvent.ts);
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('MemoryHandler', function() {
|
||||
TraceEngine.Handlers.ModelHandlers.Memory.reset();
|
||||
});
|
||||
|
||||
it('gathers update counters', async () => {
|
||||
it('gathers update counters', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'web-dev.json.gz');
|
||||
TraceEngine.Handlers.ModelHandlers.Meta.initialize();
|
||||
for (const event of events) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {TraceLoader} from '../../../helpers/TraceLoader.js';
|
||||
|
||||
describe('MetaHandler', function() {
|
||||
let baseEvents: TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
let defaultTraceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
try {
|
||||
defaultTraceEvents = await TraceLoader.rawEvents(this, 'basic.json.gz');
|
||||
@@ -166,7 +166,7 @@ describe('MetaHandler', function() {
|
||||
assert.strictEqual(data.mainFrameId, '3E1717BE677B75D0536E292E00D6A34A');
|
||||
});
|
||||
|
||||
it('finds the main frame ID for a trace that started with a page reload', async () => {
|
||||
it('finds the main frame ID for a trace that started with a page reload', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'reload-and-trace-page.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.Meta.reset();
|
||||
TraceModel.Handlers.ModelHandlers.Meta.initialize();
|
||||
@@ -178,7 +178,7 @@ describe('MetaHandler', function() {
|
||||
const data = TraceModel.Handlers.ModelHandlers.Meta.data();
|
||||
assert.strictEqual(data.mainFrameId, '1D148CB660D1F96ED70D78DC6A53267B');
|
||||
});
|
||||
it('tracks the frames for found processes', async () => {
|
||||
it('tracks the frames for found processes', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'reload-and-trace-page.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.Meta.reset();
|
||||
TraceModel.Handlers.ModelHandlers.Meta.initialize();
|
||||
@@ -199,7 +199,7 @@ describe('MetaHandler', function() {
|
||||
});
|
||||
|
||||
describe('finding GPU thread and main frame', function() {
|
||||
it('finds the GPU process and GPU Thread', async () => {
|
||||
it('finds the GPU process and GPU Thread', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'threejs-gpu.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.Meta.reset();
|
||||
TraceModel.Handlers.ModelHandlers.Meta.initialize();
|
||||
@@ -212,7 +212,7 @@ describe('MetaHandler', function() {
|
||||
assert.strictEqual(gpuThreadId, TraceModel.Types.TraceEvents.ThreadID(3581327));
|
||||
});
|
||||
|
||||
it('handles traces that do not have a GPU thread and returns undefined for the thread ID', async () => {
|
||||
it('handles traces that do not have a GPU thread and returns undefined for the thread ID', async function() {
|
||||
const traceEventsWithNoGPUThread = await TraceLoader.rawEvents(this, 'forced-layouts-and-no-gpu.json.gz');
|
||||
for (const event of traceEventsWithNoGPUThread) {
|
||||
TraceModel.Handlers.ModelHandlers.Meta.handleEvent(event);
|
||||
@@ -227,7 +227,7 @@ describe('MetaHandler', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('obtains renderer process IDs when there are no navigations', async () => {
|
||||
it('obtains renderer process IDs when there are no navigations', async function() {
|
||||
let traceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
try {
|
||||
traceEvents = await TraceLoader.rawEvents(this, 'threejs-gpu.json.gz');
|
||||
@@ -265,7 +265,7 @@ describe('MetaHandler', function() {
|
||||
}]);
|
||||
});
|
||||
|
||||
it('handles multiple renderers from navigations', async () => {
|
||||
it('handles multiple renderers from navigations', async function() {
|
||||
let traceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
try {
|
||||
traceEvents = await TraceLoader.rawEvents(this, 'multiple-top-level-renderers.json.gz');
|
||||
@@ -323,7 +323,7 @@ describe('MetaHandler', function() {
|
||||
]);
|
||||
});
|
||||
|
||||
it('calculates trace bounds correctly', async () => {
|
||||
it('calculates trace bounds correctly', async function() {
|
||||
let traceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
try {
|
||||
traceEvents = await TraceLoader.rawEvents(this, 'basic.json.gz');
|
||||
@@ -352,7 +352,7 @@ describe('MetaHandler', function() {
|
||||
assert.strictEqual(range, expectedMax - expectedMin, 'Range calculated incorrectly');
|
||||
});
|
||||
|
||||
it('ignores ::UMA Events', async () => {
|
||||
it('ignores ::UMA Events', async function() {
|
||||
let traceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
try {
|
||||
// This file contains UMA events which need to be ignored.
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('NetworkRequestsHandler', function() {
|
||||
TraceModel.Handlers.ModelHandlers.NetworkRequests.initialize();
|
||||
});
|
||||
|
||||
it('calculates network requests correctly', async () => {
|
||||
it('calculates network requests correctly', async function() {
|
||||
const traceEvents = await TraceLoader.rawEvents(this, 'load-simple.json.gz');
|
||||
for (const event of traceEvents) {
|
||||
TraceModel.Handlers.ModelHandlers.Meta.handleEvent(event);
|
||||
@@ -212,7 +212,7 @@ describe('NetworkRequestsHandler', function() {
|
||||
TraceModel.Handlers.ModelHandlers.NetworkRequests.initialize();
|
||||
});
|
||||
|
||||
it('changes priority of the resouce', async () => {
|
||||
it('changes priority of the resouce', async function() {
|
||||
const traceEvents = await TraceLoader.rawEvents(this, 'changing-priority.json.gz');
|
||||
|
||||
for (const event of traceEvents) {
|
||||
@@ -243,7 +243,7 @@ describe('NetworkRequestsHandler', function() {
|
||||
TraceModel.Handlers.ModelHandlers.NetworkRequests.initialize();
|
||||
});
|
||||
|
||||
it('calculates redirects correctly (navigations)', async () => {
|
||||
it('calculates redirects correctly (navigations)', async function() {
|
||||
const traceEvents = await TraceLoader.rawEvents(this, 'redirects.json.gz');
|
||||
for (const event of traceEvents) {
|
||||
TraceModel.Handlers.ModelHandlers.Meta.handleEvent(event);
|
||||
@@ -276,7 +276,7 @@ describe('NetworkRequestsHandler', function() {
|
||||
'Incorrect number of redirects (request 1)');
|
||||
});
|
||||
|
||||
it('calculates redirects correctly (subresources)', async () => {
|
||||
it('calculates redirects correctly (subresources)', async function() {
|
||||
const traceEvents = await TraceLoader.rawEvents(this, 'redirects-subresource-multiple.json.gz');
|
||||
for (const event of traceEvents) {
|
||||
TraceModel.Handlers.ModelHandlers.Meta.handleEvent(event);
|
||||
|
||||
@@ -22,7 +22,7 @@ function countMetricOcurrences(
|
||||
|
||||
describe('PageLoadMetricsHandler', function() {
|
||||
describe('contentful paints', () => {
|
||||
it('obtains all the FCP and LCP events for all frames', async () => {
|
||||
it('obtains all the FCP and LCP events for all frames', async function() {
|
||||
const {Meta, PageLoadMetrics} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');
|
||||
const {mainFrameId} = Meta;
|
||||
const pageLoadMetricsData = PageLoadMetrics.metricScoresByFrameId;
|
||||
@@ -49,7 +49,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
assert.strictEqual(lcpCount, 2);
|
||||
});
|
||||
|
||||
it('finds the right FCP and LCP events for a trace for a page that was refreshed', async () => {
|
||||
it('finds the right FCP and LCP events for a trace for a page that was refreshed', async function() {
|
||||
const {Meta, PageLoadMetrics} = await TraceLoader.traceEngine(this, 'reload-and-trace-page.json.gz');
|
||||
const {mainFrameId} = Meta;
|
||||
const pageLoadMetricsData = PageLoadMetrics.metricScoresByFrameId;
|
||||
@@ -72,7 +72,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
assert.strictEqual(lcpCount, 1);
|
||||
});
|
||||
|
||||
it('stores the navigation event as part of the metric', async () => {
|
||||
it('stores the navigation event as part of the metric', async function() {
|
||||
const {Meta, PageLoadMetrics} = await TraceLoader.traceEngine(this, 'reload-and-trace-page.json.gz');
|
||||
const {mainFrameId, navigationsByFrameId} = Meta;
|
||||
const navigationBeforeMetrics = navigationsByFrameId.get(mainFrameId)?.[0];
|
||||
@@ -101,7 +101,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
});
|
||||
|
||||
describe('markDOMContent frame', () => {
|
||||
it('obtains them and assigns them to the correct frames', async () => {
|
||||
it('obtains them and assigns them to the correct frames', async function() {
|
||||
const {Meta, PageLoadMetrics} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');
|
||||
const {mainFrameId} = Meta;
|
||||
const pageLoadMetricsData = PageLoadMetrics.metricScoresByFrameId;
|
||||
@@ -133,7 +133,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
}
|
||||
const firstNavigationId = '05059ACF683224E6FC7E344F544A4050';
|
||||
const secondNavigationId = '550FC08C662EF691E1535F305CBC0FCA';
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
const {PageLoadMetrics, Meta} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');
|
||||
const pageLoadMetricsData = PageLoadMetrics.metricScoresByFrameId.get(Meta.mainFrameId);
|
||||
if (!pageLoadMetricsData) {
|
||||
@@ -219,7 +219,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
assertMetricNavigationId(firstContentfulPaints[1], secondNavigationId);
|
||||
});
|
||||
|
||||
it('provides metric scores sorted in ASC order by their events\' timestamps', async () => {
|
||||
it('provides metric scores sorted in ASC order by their events\' timestamps', async function() {
|
||||
const {PageLoadMetrics, Meta} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');
|
||||
|
||||
const pageLoadMetricsData = PageLoadMetrics.metricScoresByFrameId.get(Meta.mainFrameId);
|
||||
@@ -246,7 +246,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
});
|
||||
|
||||
describe('FLEDGE fenced frames', () => {
|
||||
it('is able to parse a trace containing fenced frames without erroring', async () => {
|
||||
it('is able to parse a trace containing fenced frames without erroring', async function() {
|
||||
const {PageLoadMetrics} = await TraceLoader.traceEngine(this, 'fenced-frame-fledge.json.gz');
|
||||
assert.strictEqual(PageLoadMetrics.metricScoresByFrameId.size, 3);
|
||||
});
|
||||
@@ -255,7 +255,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
describe('Marker events', () => {
|
||||
let mainFrameId: string;
|
||||
let allMarkerEvents: TraceModel.Types.TraceEvents.PageLoadEvent[];
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
const {PageLoadMetrics, Meta} = await TraceLoader.traceEngine(this, 'multiple-navigations-with-iframes.json.gz');
|
||||
mainFrameId = Meta.mainFrameId;
|
||||
allMarkerEvents = PageLoadMetrics.allMarkerEvents;
|
||||
@@ -276,7 +276,7 @@ describe('PageLoadMetricsHandler', function() {
|
||||
}
|
||||
});
|
||||
|
||||
it('only stores the largest contentful paint with the highest candidate index', async () => {
|
||||
it('only stores the largest contentful paint with the highest candidate index', async function() {
|
||||
const {PageLoadMetrics} = await TraceLoader.traceEngine(this, 'multiple-lcp-main-frame.json.gz');
|
||||
const pageLoadMarkers = PageLoadMetrics.allMarkerEvents;
|
||||
const largestContentfulPaints =
|
||||
|
||||
@@ -997,7 +997,7 @@ describe('RendererHandler', function() {
|
||||
let defaultTraceEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
const pid = TraceModel.Types.TraceEvents.ProcessID(28274);
|
||||
const tid = TraceModel.Types.TraceEvents.ThreadID(775);
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
defaultTraceEvents = await TraceLoader.rawEvents(this, 'basic.json.gz');
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('ScreenshotHandler', function() {
|
||||
|
||||
let baseEvents: readonly TraceModel.Types.TraceEvents.TraceEventData[];
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
const defaultTraceEvents = await TraceLoader.rawEvents(this, 'basic.json.gz');
|
||||
|
||||
baseEvents = [
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('UserInteractionsHandler', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns all user interactions', async () => {
|
||||
it('returns all user interactions', async function() {
|
||||
const traceEvents = await TraceLoader.rawEvents(this, 'slow-interaction-button-click.json.gz');
|
||||
for (const event of traceEvents) {
|
||||
TraceModel.Handlers.ModelHandlers.UserInteractions.handleEvent(event);
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('UserTimingsHandler', function() {
|
||||
await TraceModel.Handlers.ModelHandlers.UserTimings.finalize();
|
||||
return TraceModel.Handlers.ModelHandlers.UserTimings.data();
|
||||
}
|
||||
before(async () => {
|
||||
before(async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'user-timings.json.gz');
|
||||
timingsData = await getTimingsDataFromEvents(events);
|
||||
});
|
||||
@@ -46,7 +46,7 @@ describe('UserTimingsHandler', function() {
|
||||
}
|
||||
});
|
||||
|
||||
it('sorts the blocks to ensure they are in time order', async () => {
|
||||
it('sorts the blocks to ensure they are in time order', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'user-timings.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.UserTimings.reset();
|
||||
// Reverse the array so that the events are in the wrong order.
|
||||
@@ -63,7 +63,7 @@ describe('UserTimingsHandler', function() {
|
||||
assert.isTrue(data.performanceMeasures[1].ts <= data.performanceMeasures[2].ts);
|
||||
});
|
||||
|
||||
it('calculates the duration correctly from the begin/end event timestamps', async () => {
|
||||
it('calculates the duration correctly from the begin/end event timestamps', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'user-timings.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.UserTimings.reset();
|
||||
for (const event of events) {
|
||||
@@ -76,7 +76,7 @@ describe('UserTimingsHandler', function() {
|
||||
assert.strictEqual(timing.dur, timing.args.data.endEvent.ts - timing.args.data.beginEvent.ts);
|
||||
}
|
||||
});
|
||||
it('correctly extracts nested timings in the correct order', async () => {
|
||||
it('correctly extracts nested timings in the correct order', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'user-timings-complex.json.gz');
|
||||
const complexTimingsData = await getTimingsDataFromEvents(events);
|
||||
const userTimingEventNames = [];
|
||||
@@ -93,7 +93,7 @@ describe('UserTimingsHandler', function() {
|
||||
'nested-d',
|
||||
]);
|
||||
});
|
||||
it('correctly orders measures when one measure encapsulates the others', async () => {
|
||||
it('correctly orders measures when one measure encapsulates the others', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'user-timings-complex.json.gz');
|
||||
const complexTimingsData = await getTimingsDataFromEvents(events);
|
||||
const userTimingEventNames = [];
|
||||
@@ -119,7 +119,7 @@ describe('UserTimingsHandler', function() {
|
||||
});
|
||||
});
|
||||
describe('console timings', function() {
|
||||
before(async () => {
|
||||
before(async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'timings-track.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.UserTimings.reset();
|
||||
for (const event of events) {
|
||||
@@ -149,7 +149,7 @@ describe('UserTimingsHandler', function() {
|
||||
}
|
||||
});
|
||||
|
||||
it('sorts the blocks to ensure they are in time order', async () => {
|
||||
it('sorts the blocks to ensure they are in time order', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'timings-track.json.gz');
|
||||
TraceModel.Handlers.ModelHandlers.UserTimings.reset();
|
||||
// Reverse the array so that the events are in the wrong order.
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('WarningsHandler', function() {
|
||||
TraceEngine.Handlers.ModelHandlers.Warnings.reset();
|
||||
});
|
||||
|
||||
it('identifies long tasks', async () => {
|
||||
it('identifies long tasks', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'slow-interaction-keydown.json.gz');
|
||||
for (const event of events) {
|
||||
TraceEngine.Handlers.ModelHandlers.Warnings.handleEvent(event);
|
||||
@@ -22,7 +22,7 @@ describe('WarningsHandler', function() {
|
||||
assert.strictEqual(event?.name, TraceEngine.Types.TraceEvents.KnownEventName.RunTask);
|
||||
});
|
||||
|
||||
it('identifies idle callbacks that ran over the allotted time', async () => {
|
||||
it('identifies idle callbacks that ran over the allotted time', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'idle-callback.json.gz');
|
||||
for (const event of events) {
|
||||
TraceEngine.Handlers.ModelHandlers.Warnings.handleEvent(event);
|
||||
@@ -34,7 +34,7 @@ describe('WarningsHandler', function() {
|
||||
assert.deepEqual(data.perEvent.get(event), ['IDLE_CALLBACK_OVER_TIME']);
|
||||
});
|
||||
|
||||
it('identifies layout events that take over 10ms', async () => {
|
||||
it('identifies layout events that take over 10ms', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'large-layout-small-recalc.json.gz');
|
||||
for (const event of events) {
|
||||
TraceEngine.Handlers.ModelHandlers.Warnings.handleEvent(event);
|
||||
@@ -52,7 +52,7 @@ describe('WarningsHandler', function() {
|
||||
assert.lengthOf(styleRecalcs, 0);
|
||||
});
|
||||
|
||||
it('identifies style recalc events that take over 10ms', async () => {
|
||||
it('identifies style recalc events that take over 10ms', async function() {
|
||||
const events = await TraceLoader.rawEvents(this, 'large-recalc-style.json.gz');
|
||||
for (const event of events) {
|
||||
TraceEngine.Handlers.ModelHandlers.Warnings.handleEvent(event);
|
||||
|
||||
@@ -59,7 +59,7 @@ describeWithEnvironment('SamplesIntegrator', function() {
|
||||
});
|
||||
|
||||
describe('buildProfileCalls', () => {
|
||||
it('generates profile calls using trace events and JS samples from a trace file', async () => {
|
||||
it('generates profile calls using trace events and JS samples from a trace file', async function() {
|
||||
const data = await TraceLoader.traceEngine(this, 'recursive-blocking-js.json.gz');
|
||||
const samplesData = data.Samples;
|
||||
assert.strictEqual(samplesData.profilesInProcess.size, 1);
|
||||
|
||||
@@ -8,19 +8,19 @@ const {assert} = chai;
|
||||
|
||||
describe('TraceModel helpers', function() {
|
||||
describe('extractOriginFromTrace', () => {
|
||||
it('extracts the origin of a parsed trace correctly', async () => {
|
||||
it('extracts the origin of a parsed trace correctly', async function() {
|
||||
const model = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
|
||||
const origin = TraceModel.Helpers.Trace.extractOriginFromTrace(model.Meta.mainFrameURL);
|
||||
assert.strictEqual(origin, 'web.dev');
|
||||
});
|
||||
|
||||
it('will remove the `www` if it is present', async () => {
|
||||
it('will remove the `www` if it is present', async function() {
|
||||
const traceEvents = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz');
|
||||
const origin = TraceModel.Helpers.Trace.extractOriginFromTrace(traceEvents.Meta.mainFrameURL);
|
||||
assert.strictEqual(origin, 'google.com');
|
||||
});
|
||||
|
||||
it('returns null when no origin is found', async () => {
|
||||
it('returns null when no origin is found', async function() {
|
||||
const traceEvents = await TraceLoader.traceEngine(this, 'basic.json.gz');
|
||||
const origin = TraceModel.Helpers.Trace.extractOriginFromTrace(traceEvents.Meta.mainFrameURL);
|
||||
assert.isNull(origin);
|
||||
@@ -100,7 +100,7 @@ describe('TraceModel helpers', function() {
|
||||
});
|
||||
|
||||
describe('getNavigationForTraceEvent', () => {
|
||||
it('returns the correct navigation for a request', async () => {
|
||||
it('returns the correct navigation for a request', async function() {
|
||||
const {NetworkRequests, Meta} = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz');
|
||||
const request1 = NetworkRequests.byTime[0];
|
||||
const navigationForFirstRequest = TraceModel.Helpers.Trace.getNavigationForTraceEvent(
|
||||
@@ -113,7 +113,7 @@ describe('TraceModel helpers', function() {
|
||||
assert.strictEqual(navigationForSecondRequest?.ts, TraceModel.Types.Timing.MicroSeconds(636471400029));
|
||||
});
|
||||
|
||||
it('returns the correct navigation for a page load event', async () => {
|
||||
it('returns the correct navigation for a page load event', async function() {
|
||||
const {PageLoadMetrics, Meta} = await TraceLoader.traceEngine(this, 'multiple-navigations.json.gz');
|
||||
const firstNavigationId = Meta.navigationsByNavigationId.keys().next().value;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ describeWithEnvironment('TimelineHistoryManager', function() {
|
||||
UI.ActionRegistry.ActionRegistry.reset();
|
||||
});
|
||||
|
||||
it('can select from multiple parsed data objects', async () => {
|
||||
it('can select from multiple parsed data objects', async function() {
|
||||
// Add two parsed data objects to the history manager.
|
||||
const firstFileModels = await TraceLoader.allModels(this, 'slow-interaction-button-click.json.gz');
|
||||
historyManager.addRecording(
|
||||
|
||||
@@ -8,7 +8,7 @@ import {describeWithEnvironment} from '../../helpers/EnvironmentHelpers.js';
|
||||
import {TraceLoader} from '../../helpers/TraceLoader.js';
|
||||
|
||||
describeWithEnvironment('TimelineMiniMap', function() {
|
||||
it('always shows the responsiveness, CPU activity and network panel', async () => {
|
||||
it('always shows the responsiveness, CPU activity and network panel', async function() {
|
||||
const models = await TraceLoader.allModels(this, 'web-dev.json.gz');
|
||||
|
||||
const container = document.createElement('div');
|
||||
@@ -36,7 +36,7 @@ describeWithEnvironment('TimelineMiniMap', function() {
|
||||
minimap.detach();
|
||||
});
|
||||
|
||||
it('will show the other panels if they are set to visible', async () => {
|
||||
it('will show the other panels if they are set to visible', async function() {
|
||||
const models = await TraceLoader.allModels(this, 'web-dev.json.gz');
|
||||
|
||||
const container = document.createElement('div');
|
||||
|
||||
@@ -30,7 +30,7 @@ describeWithEnvironment('GPUTrackAppender', function() {
|
||||
let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();
|
||||
let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
const data = await TraceLoader.allModels(this, 'threejs-gpu.json.gz');
|
||||
traceParsedData = data.traceParsedData;
|
||||
timelineModel = data.timelineModel;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ describeWithEnvironment('NetworkTrackAppender', function() {
|
||||
let networkTrackAppender: Timeline.NetworkTrackAppender.NetworkTrackAppender;
|
||||
let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
traceParsedData = await TraceLoader.traceEngine(this, 'cls-cluster-max-timeout.json.gz');
|
||||
networkTrackAppender = new Timeline.NetworkTrackAppender.NetworkTrackAppender(traceParsedData, flameChartData);
|
||||
networkTrackAppender.appendTrackAtLevel(0);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ describeWithEnvironment('TimingTrackAppender', function() {
|
||||
let entryData: Timeline.TimelineFlameChartDataProvider.TimelineFlameChartEntry[] = [];
|
||||
let flameChartData = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();
|
||||
let entryTypeByLevel: Timeline.TimelineFlameChartDataProvider.EntryType[] = [];
|
||||
beforeEach(async () => {
|
||||
beforeEach(async function() {
|
||||
const data = await TraceLoader.allModels(this, 'timings-track.json.gz');
|
||||
traceParsedData = data.traceParsedData;
|
||||
timingsTrackAppender =
|
||||
|
||||
Reference in New Issue
Block a user