Skip to content

Commit

Permalink
Remove TraceOfTab (#340)
Browse files Browse the repository at this point in the history
* Remove TraceOfTab
  • Loading branch information
adamraine authored May 16, 2022
1 parent ab007ae commit 19887b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 8 additions & 3 deletions lighthouse-plugin-publisher-ads/audits/blocking-load-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

const i18n = require('lighthouse/lighthouse-core/lib/i18n/i18n.js');
const NetworkRecords = require('lighthouse/lighthouse-core/computed/network-records.js');
// @ts-ignore
const TraceOfTab = require('lighthouse/lighthouse-core/computed/trace-of-tab.js');
// @ts-expect-error
const ProcessedTrace = require('lighthouse/lighthouse-core/computed/processed-trace.js');
// @ts-expect-error
const ProcessedNavigation = require('lighthouse/lighthouse-core/computed/processed-navigation.js');
const {auditNotApplicable} = require('../messages/common-strings');
const {Audit} = require('lighthouse');
const {computeAdRequestWaterfall} = require('../utils/graph');
Expand Down Expand Up @@ -177,7 +179,10 @@ class BlockingLoadEvents extends Audit {
const trace = artifacts.traces[Audit.DEFAULT_PASS];
const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];
const networkRecords = await NetworkRecords.request(devtoolsLog, context);
const {timings, processEvents} = await TraceOfTab.request(trace, context);
const processedTrace = await ProcessedTrace.request(trace, context);
const {timings} = await ProcessedNavigation
.request(processedTrace, context);
const {processEvents} = processedTrace;
/** @type {Map<NetworkRequest, NodeTiming>} */
const timingsByRecord =
await getTimingsByRecord(trace, devtoolsLog, context);
Expand Down
10 changes: 7 additions & 3 deletions lighthouse-plugin-publisher-ads/audits/idle-network-times.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
const i18n = require('lighthouse/lighthouse-core/lib/i18n/i18n.js');
const MainThreadTasks = require('lighthouse/lighthouse-core/computed/main-thread-tasks.js');
const NetworkRecords = require('lighthouse/lighthouse-core/computed/network-records.js');
// @ts-ignore
const TraceOfTab = require('lighthouse/lighthouse-core/computed/trace-of-tab.js');
// @ts-expect-error
const ProcessedTrace = require('lighthouse/lighthouse-core/computed/processed-trace.js');
// @ts-expect-error
const ProcessedNavigation = require('lighthouse/lighthouse-core/computed/processed-navigation.js');
const {auditNotApplicable} = require('../messages/common-strings');
const {Audit} = require('lighthouse');
const {computeAdRequestWaterfall} = require('../utils/graph');
Expand Down Expand Up @@ -269,7 +271,9 @@ class IdleNetworkTimes extends Audit {
} catch (e) {
// Ignore tracing errors.
}
const {timings} = await TraceOfTab.request(trace, context);
const processedTrace = await ProcessedTrace.request(trace, context);
const {timings} = await ProcessedNavigation
.request(processedTrace, context);

const timerEvents =
trace.traceEvents.filter((t) => t.name.startsWith('Timer'));
Expand Down

0 comments on commit 19887b9

Please sign in to comment.