Commit 3942b3c7 authored by Keishi Hattori's avatar Keishi Hattori Committed by Commit Bot

Revert "desks: Enable enhanced desk animations by default."

This reverts commit 3a6b8b82.

Reason for revert: Speculative revert for DesksGestureHandlerTest.HorizontalScrolls and ReverseGestureHandlerTest.SwitchDesk failure on linux-chromeos-dbg
crbug.com/1150701

Original change's description:
> desks: Enable enhanced desk animations by default.
>
> Enabling also exposed a DCHECK where the throughput tracker was being
> Stopped when it was not started. This was previously missed, because
> manual testing was all done on a device, where DCHECKs were disabled.
>
> Bug: 1148923
> Test: none
> Change-Id: I9c9236f04da072e0a63eb118db0969716a71ffdd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537131
> Commit-Queue: Sammie Quon <sammiequon@chromium.org>
> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#828916}

TBR=afakhry@chromium.org,sammiequon@chromium.org

Change-Id: I2db6cb1342dc0d20d0374d5da96dc9988dbfd5a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1148923
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547855Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829090}
parent 28e8876c
......@@ -45,7 +45,7 @@ const base::Feature kDragToSnapInClamshellMode{
"DragToSnapInClamshellMode", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kEnhancedDeskAnimations{"EnhancedDeskAnimations",
base::FEATURE_ENABLED_BY_DEFAULT};
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kFullRestore{"FullRestore",
base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -33,10 +33,7 @@ void DeskAnimationBase::Launch() {
for (auto& observer : controller_->observers_)
observer.OnDeskSwitchAnimationLaunching();
// The throughput tracker measures the animation when the user lifts their
// fingers off the trackpad, which is done in EndSwipeAnimation.
if (!is_continuous_gesture_animation_)
throughput_tracker_.Start(GetReportCallback());
throughput_tracker_.Start(GetReportCallback());
// This step makes sure that the containers of the target desk are shown at
// the beginning of the animation (but not actually visible to the user yet,
......
......@@ -83,11 +83,6 @@ bool DeskActivationAnimation::Replace(bool moving_left,
if (source != switch_source_)
return false;
// Do not log any EndSwipeAnimation smoothness metrics if the animation has
// been canceled midway by an Replace call.
if (is_continuous_gesture_animation_)
throughput_tracker_.Cancel();
// If any of the animators are still taking either screenshot, do not replace
// the animation.
for (const auto& animator : desk_switch_animators_) {
......@@ -140,6 +135,10 @@ bool DeskActivationAnimation::UpdateSwipeAnimation(float scroll_delta_x) {
if (!is_continuous_gesture_animation_)
return false;
// Do not log any EndSwipeAnimation smoothness metrics if the animation has
// been canceled midway by an UpdateSwipeAnimation call.
throughput_tracker_.Cancel();
presentation_time_recorder_->RequestNext();
// List of animators that need a screenshot. It should be either empty or
......
......@@ -81,8 +81,6 @@ void AddDesk() {
class WmGestureHandlerTest : public AshTestBase {
public:
WmGestureHandlerTest() = default;
WmGestureHandlerTest(const WmGestureHandlerTest&) = delete;
WmGestureHandlerTest& operator=(const WmGestureHandlerTest&) = delete;
~WmGestureHandlerTest() override = default;
void Scroll(float x_offset, float y_offset, int fingers) {
......@@ -92,16 +90,11 @@ class WmGestureHandlerTest : public AshTestBase {
}
void ScrollToSwitchDesks(bool scroll_left) {
// Theres no animation when scrolling with enhanced desk animations, so no
// need to wait.
auto waiter = features::IsEnhancedDeskAnimations()
? nullptr
: std::make_unique<DeskSwitchAnimationWaiter>();
DeskSwitchAnimationWaiter waiter;
const float x_offset =
(scroll_left ? -1 : 1) * WmGestureHandler::kHorizontalThresholdDp;
Scroll(x_offset, 0, kNumFingersForDesksSwitch);
if (waiter)
waiter->Wait();
waiter.Wait();
}
void MouseWheelScroll(int delta_x, int delta_y, int num_of_times) {
......@@ -109,6 +102,9 @@ class WmGestureHandlerTest : public AshTestBase {
for (int i = 0; i < num_of_times; i++)
generator->MoveMouseWheel(delta_x, delta_y);
}
private:
DISALLOW_COPY_AND_ASSIGN(WmGestureHandlerTest);
};
// Tests a three fingers upwards scroll gesture to enter and a scroll down to
......@@ -283,11 +279,6 @@ TEST_F(DesksGestureHandlerTest, NoDeskChanges) {
// Tests that a large scroll only moves to the next desk.
TEST_F(DesksGestureHandlerTest, NoDoubleDeskChange) {
// Enhanced desk animations supports switching multiple desks with large
// enough scrolls.
if (features::IsEnhancedDeskAnimations())
return;
auto* desk_controller = DesksController::Get();
desk_controller->NewDesk(DesksCreationRemovalSource::kButton);
desk_controller->NewDesk(DesksCreationRemovalSource::kButton);
......
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