Commit 8567684e authored by DongJun Kim's avatar DongJun Kim Committed by Commit Bot

Disable animation in AutofillUiTest

This patch sets ui::ScopedAnimationDurationScaleMode::ZERO_DURATION
for disabling animation in AutofillUiTest.

Bug: 1066905
Signed-off-by: default avatarDongJun Kim <djmix.kim@samsung.com>
Change-Id: I26ef6b54e5bff12c2bbeadd67d8b017bb61fd273
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134100Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757180}
parent 69d7a422
......@@ -78,6 +78,9 @@ void AutofillUiTest::SetUpOnMainThread() {
/* new_host = */ GetWebContents()->GetMainFrame());
Observe(GetWebContents());
disable_animation_ = std::make_unique<ui::ScopedAnimationDurationScaleMode>(
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION);
// If the mouse happened to be over where the suggestions are shown, then
// the preview will show up and will fail the tests. We need to give it a
// point that's within the browser frame, or else the method hangs.
......
......@@ -16,6 +16,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/events/keycodes/keyboard_codes.h"
......@@ -114,6 +115,8 @@ class AutofillUiTest : public InProcessBrowserTest,
// with it.
content::RenderWidgetHost::KeyPressEventCallback key_press_event_sink_;
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> disable_animation_;
DISALLOW_COPY_AND_ASSIGN(AutofillUiTest);
};
......
......@@ -21,6 +21,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"
......@@ -45,6 +46,9 @@ class AutofillPopupControllerBrowserTest : public InProcessBrowserTest,
std::make_unique<TestAutofillExternalDelegate>(
driver->autofill_manager(), driver,
/*call_parent_methods=*/true);
disable_animation_ = std::make_unique<ui::ScopedAnimationDurationScaleMode>(
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION);
}
// Normally the WebContents will automatically delete the delegate, but here
......@@ -56,6 +60,7 @@ class AutofillPopupControllerBrowserTest : public InProcessBrowserTest,
protected:
std::unique_ptr<TestAutofillExternalDelegate> autofill_external_delegate_;
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> disable_animation_;
};
#if defined(OS_MACOSX)
......
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