0

Update pixel tests for ChromeRefresh2023 ash/touch

Test includes an old style textfield that is now updated for GM3.
Changes to the border color, background color, and shape are expected.

Bug: b:326288692
Change-Id: Ib719182fe25497f8722b2e11cb4f735be4f78c5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5318787
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Auto-Submit: Sean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264632}
This commit is contained in:
Sean Kau
2024-02-23 18:00:10 +00:00
committed by Chromium LUCI CQ
parent 3b4fde3a53
commit 672a618ed2

@ -7,6 +7,8 @@
#include "ash/test/ash_test_base.h"
#include "ash/test/pixel/ash_pixel_differ.h"
#include "ash/test/pixel/ash_pixel_test_init_params.h"
#include "base/test/scoped_feature_list.h"
#include "ui/base/ui_base_features.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
@ -31,7 +33,13 @@ gfx::Rect GetCursorBoundsInScreen(views::Textfield* textfield, int cursor_pos) {
class TouchSelectionPixelTest : public AshTestBase {
public:
TouchSelectionPixelTest() = default;
TouchSelectionPixelTest() {
scoped_features_.InitWithFeatures({::features::kChromeRefresh2023,
::features::kChromeRefreshSecondary2023,
::features::kChromeRefresh2023NTB},
{});
}
TouchSelectionPixelTest(const TouchSelectionPixelTest&) = delete;
TouchSelectionPixelTest& operator=(const TouchSelectionPixelTest&) = delete;
~TouchSelectionPixelTest() override = default;
@ -55,6 +63,8 @@ class TouchSelectionPixelTest : public AshTestBase {
// triggered.
ui::ScopedAnimationDurationScaleMode disable_animations_{
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION};
base::test::ScopedFeatureList scoped_features_;
};
TEST_F(TouchSelectionPixelTest, MagnifierOnTextfield) {
@ -76,7 +86,7 @@ TEST_F(TouchSelectionPixelTest, MagnifierOnTextfield) {
EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen(
"touch_selection",
/*revision_number=*/1, widget.get()));
/*revision_number=*/2, widget.get()));
}
} // namespace