chromium/third_party/blink/web_tests/wpt_internal/long-animation-frame/loaf-ukm.html

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async () => {
  const very_long_frame_duration = 250;
  const recorder = internals.initializeUKMRecorder();
  await new Promise(resolve => requestAnimationFrame(() => {
    const before = performance.now();
    document.querySelector("#log").innerHTML = "Update";
    while (performance.now() < (before + very_long_frame_duration)) {}
    requestAnimationFrame(resolve);
  }));

  let found = false;
  const entries = recorder.getMetrics(
    "PerformanceAPI.LongAnimationFrame",
    ["Duration.Total", "DidPause"]);
  assert_greater_than_equal(entries.length, 1);
  const metrics = entries[0];
  assert_equals(metrics["DidPause"], 0);
}, "UKM recorder should receive LoAF entries");
</script>
<body>
  <div id="log"></div>
</body>