Commit 9fca1bc1 authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

[LargestContentfulPaint] Add type to supportedEntryTypes

This CL adds 'largest-contentful-paint' to PerformanceObserver's
supportedEntryTypes, and adds a test. It also fixes a typo in the
LayoutShift supportedEntryTypes test title.

Bug: 965505
Change-Id: I6954f8abbdf27640413d790e05ff72aa945a248b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713295
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680131}
parent 74785c25
......@@ -62,6 +62,10 @@ Vector<AtomicString> PerformanceObserver::supportedEntryTypes(
if (RuntimeEnabledFeatures::EventTimingEnabled(execution_context))
supportedEntryTypes.push_back(performance_entry_names::kEvent);
supportedEntryTypes.push_back(performance_entry_names::kFirstInput);
if (RuntimeEnabledFeatures::LargestContentfulPaintEnabled()) {
supportedEntryTypes.push_back(
performance_entry_names::kLargestContentfulPaint);
}
if (RuntimeEnabledFeatures::LayoutInstabilityAPIEnabled(execution_context))
supportedEntryTypes.push_back(performance_entry_names::kLayoutShift);
supportedEntryTypes.push_back(performance_entry_names::kLongtask);
......
<!DOCTYPE html>
<head>
<title>PerformanceObserver.supportedEntryTypes contains "largest-contentful-paint"</title>
</head>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
if (typeof PerformanceObserver.supportedEntryTypes === "undefined")
assert_unreached("supportedEntryTypes is not supported.");
assert_greater_than(PerformanceObserver.supportedEntryTypes.indexOf("largest-contentful-paint"), -1,
"There should be an entry 'largest-contentful-paint' in PerformanceObserver.supportedEntryTypes");
}, "supportedEntryTypes contains 'largest-contentful-paint'.");
</script>
</body>
</html>
<!DOCTYPE html>
<head>
<title>PerformanceObserver.supportedEntryTypes contains "layoutShift"</title>
<title>PerformanceObserver.supportedEntryTypes contains "layout-shift"</title>
</head>
<body>
<script src="/resources/testharness.js"></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment