41f675bc44ecf4596f03ea5753afa826c2b1a455 - chromium/src

2,456 views
Skip to first unread message

lea...@chromium.org

unread,
Mar 1, 2022, 7:51:24 PM3/1/22
to chromium...@chromium.org
commit 41f675bc44ecf4596f03ea5753afa826c2b1a455
Author: Andre Le <lea...@chromium.org>
AuthorDate: Wed Mar 02 00:50:16 2022
Commit: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
CommitDate: Wed Mar 02 00:50:16 2022

Fix flaky animation smoothness record unit tests

The animation histogram record unit tests of AshNotificationView are
flaky. This is caused by the fact that histogram did not record after
the timeframe given after animation ended. This CL increases that given
timeframe to allow the histogram recording.

Fixed: 1300362
TEST: locally with linux-chromeos-rel/ash_unittests
Change-Id: I443e39ee495d755164e56db5a010bb4aac3d45d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3498525
Reviewed-by: Xiyuan Xia <xiy...@chromium.org>
Reviewed-by: Alex Newcomer <newc...@chromium.org>
Commit-Queue: Andre Le <lea...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976489}

diff --git a/ash/system/message_center/ash_notification_view_unittest.cc b/ash/system/message_center/ash_notification_view_unittest.cc
index 518f2ac..8ae1675 100644
--- a/ash/system/message_center/ash_notification_view_unittest.cc
+++ b/ash/system/message_center/ash_notification_view_unittest.cc
@@ -20,6 +20,7 @@
#include "ash/test/ash_test_base.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
+#include "base/time/time.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
@@ -192,10 +193,11 @@
EXPECT_TRUE(ui::WaitForNextFrameToBePresented(compositor));
}

- // Ensure there is one more frame presented after animation finishes to
- // allow animation throughput data to be passed from cc to ui.
- std::ignore =
- ui::WaitForNextFrameToBePresented(compositor, base::Milliseconds(200));
+ // Force a frame then wait, ensuring there is one more frame presented after
+ // animation finishes to allow animation throughput data to be passed from
+ // cc to ui.
+ compositor->ScheduleFullRedraw();
+ EXPECT_TRUE(ui::WaitForNextFrameToBePresented(compositor));

// Smoothness should be recorded.
histograms.ExpectTotalCount(animation_histogram_name, data_point_count);
@@ -665,8 +667,7 @@
"Ash.NotificationView.ActionsRow.FadeIn.AnimationSmoothness");
}

-TEST_F(AshNotificationViewTest,
- DISABLED_ImageExpandCollapseAnimationsRecordSmoothness) {
+TEST_F(AshNotificationViewTest, ImageExpandCollapseAnimationsRecordSmoothness) {
// Enable animations.
ui::ScopedAnimationDurationScaleMode duration(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
@@ -731,8 +732,7 @@
"ScaleAndTranslate.AnimationSmoothness");
}

-TEST_F(AshNotificationViewTest,
- DISABLED_GroupExpandCollapseAnimationsRecordSmoothness) {
+TEST_F(AshNotificationViewTest, GroupExpandCollapseAnimationsRecordSmoothness) {
base::HistogramTester histograms;

// Enable animations.
@@ -839,8 +839,7 @@
"Ash.NotificationView.InlineReply.FadeOut.AnimationSmoothness");
}

-TEST_F(AshNotificationViewTest,
- DISABLED_InlineSettingsAnimationsRecordSmoothness) {
+TEST_F(AshNotificationViewTest, InlineSettingsAnimationsRecordSmoothness) {
base::HistogramTester histograms;

// Enable animations.
Reply all
Reply to author
Forward
0 new messages