Commit ffdc0558 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Fix flaky test LayerWithRealCompositorTest.CanvasDrawFadedString due to Aliasing

This CL is changing the image used as result. The win7 image was taken with
aliasing off. The bots has aliasing on by default and was turned off by
incorrect code in chrome.

  see: https://chromium-review.googlesource.com/c/chromium/src/+/1570527

The bots got fixed and the code causing flakiness is getting removed.

The expected results should be the image with aliasing activated.

NOTE TO SHERRIFS:
 If LayoutProviderTest.ExplicitTypographyLineHeight, please disable the test
 and assign the bug to me. I think I've found any cause of flakiness. If not,
 I'll dig more.

Bug: 955128
Change-Id: I753df3dc217a7aa030b4490297a4ee54344a5a87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1597277Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658565}
parent 58666728
...@@ -462,6 +462,17 @@ class TestCompositorAnimationObserver : public CompositorAnimationObserver { ...@@ -462,6 +462,17 @@ class TestCompositorAnimationObserver : public CompositorAnimationObserver {
DISALLOW_COPY_AND_ASSIGN(TestCompositorAnimationObserver); DISALLOW_COPY_AND_ASSIGN(TestCompositorAnimationObserver);
}; };
#if defined(OS_WIN)
bool IsFontsSmoothingEnabled() {
BOOL antialiasing = TRUE;
BOOL result = SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &antialiasing, 0);
if (result == FALSE) {
ADD_FAILURE() << "Failed to retrieve font aliasing configuration.";
}
return antialiasing;
}
#endif
} // namespace } // namespace
TEST_F(LayerWithRealCompositorTest, Draw) { TEST_F(LayerWithRealCompositorTest, Draw) {
...@@ -1888,6 +1899,11 @@ TEST_F(LayerWithRealCompositorTest, BackgroundBlurChangeDeviceScale) { ...@@ -1888,6 +1899,11 @@ TEST_F(LayerWithRealCompositorTest, BackgroundBlurChangeDeviceScale) {
// See https://codereview.chromium.org/1634103003/#msg41 // See https://codereview.chromium.org/1634103003/#msg41
#if defined(OS_WIN) #if defined(OS_WIN)
TEST_F(LayerWithRealCompositorTest, CanvasDrawFadedString) { TEST_F(LayerWithRealCompositorTest, CanvasDrawFadedString) {
ASSERT_TRUE(IsFontsSmoothingEnabled())
<< "The test requires that fonts smoothing (anti-aliasing) is activated. "
"If this assert is failing you need to manually activate the flag in "
"your system fonts settings.";
viz::ParentLocalSurfaceIdAllocator allocator; viz::ParentLocalSurfaceIdAllocator allocator;
allocator.GenerateId(); allocator.GenerateId();
gfx::Size size(50, 50); gfx::Size size(50, 50);
...@@ -1905,9 +1921,6 @@ TEST_F(LayerWithRealCompositorTest, CanvasDrawFadedString) { ...@@ -1905,9 +1921,6 @@ TEST_F(LayerWithRealCompositorTest, CanvasDrawFadedString) {
std::string filename; std::string filename;
if (base::win::GetVersion() < base::win::Version::WIN10) { if (base::win::GetVersion() < base::win::Version::WIN10) {
filename = "string_faded_win7.png"; filename = "string_faded_win7.png";
// TODO(crbug.com/955128): Flaky.
return;
} else { } else {
filename = "string_faded_win10.png"; filename = "string_faded_win10.png";
} }
......
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