function makeTrace(shiftEventsData) {
      // If there are non-is_main_frame events, create a child frame in trace to add those events to.
      const needsChildFrame = shiftEventsData.some(e => e.is_main_frame === false);
      const childFrames = needsChildFrame ? [{frame: childFrameId}] : [];

      const trace = createTestTrace({traceEnd: 30_000, childFrames});
      const navigationStartEvt = trace.traceEvents.find(e => e.name === 'navigationStart');
      const mainFrameId = navigationStartEvt.args.frame;

      let mainCumulativeScore = 0;
      let childCumulativeScore = 0;

      /* eslint-disable camelcase */
      const shiftEvents = shiftEventsData.map(data => {
        const {
          score,
          ts,
          had_recent_input = false,
          is_main_frame = true,
          weighted_score_delta = score,
        } = data;

        if (!had_recent_input) {
          if (is_main_frame) mainCumulativeScore += score;
          else childCumulativeScore += score;
        }

        return {
          name: 'LayoutShift',
          cat: 'loading',
          ph: 'I',
          pid: 1111,
          tid: 222,
          ts: ts,
          args: {
            frame: is_main_frame ? mainFrameId : childFrameId,
            data: {
              is_main_frame,
              had_recent_input,
              score,
              cumulative_score: is_main_frame ? mainCumulativeScore : childCumulativeScore,
              weighted_score_delta,
            },
          },
        };
      });
      /* eslint-enable camelcase */

      trace.traceEvents.push(...shiftEvents);
      return trace;
    }
@param {Array<{score: number, ts: number, had_recent_input?: boolean, is_main_frame?: boolean, weighted_score_delta?: number}>} shiftEventsData