Commit 33f3caa0 authored by behdad's avatar behdad Committed by Chromium LUCI CQ

Frames started after FCP will be submitted to frame_sorter

Frames which are started prior to first contentful paint will not be added to frame_sorter and as a result would not be reported as part of normalized smoothness metrics.

Bug: 1157479
Change-Id: I665172b297c38ada0e2d468417342e5c2df06374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584647Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836278}
parent a634abb8
......@@ -85,7 +85,8 @@ void DroppedFrameCounter::ResetFrameSorter() {
}
void DroppedFrameCounter::OnBeginFrame(const viz::BeginFrameArgs& args) {
frame_sorter_.AddNewFrame(args);
if (fcp_received_)
frame_sorter_.AddNewFrame(args);
}
void DroppedFrameCounter::OnEndFrame(const viz::BeginFrameArgs& args,
......@@ -95,7 +96,9 @@ void DroppedFrameCounter::OnEndFrame(const viz::BeginFrameArgs& args,
++total_smoothness_dropped_;
ReportFrames();
}
frame_sorter_.AddFrameResult(args, is_dropped);
if (fcp_received_)
frame_sorter_.AddFrameResult(args, is_dropped);
}
void DroppedFrameCounter::ReportFrames() {
......
......@@ -254,6 +254,7 @@ class DroppedFrameCounterTest : public testing::Test {
public:
DroppedFrameCounterTest() {
dropped_frame_counter_.set_total_counter(&total_frame_counter_);
dropped_frame_counter_.OnFcpReceived();
}
~DroppedFrameCounterTest() override = default;
......
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