Commit 740d8890 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

tablet: Reenable TabletModeControllerScreenshot*.ScreenshotVisibility.

Re-try of crrev.com/c/2182409. The change is the same but this time I
was able to locally repro the original failure (and have no failures
running this) and some fixes have landed since the last attempt.

Test: none
Bug: 1035356
Change-Id: Idc53b58a70f68be05b7ad36efb18c6facdb3ad56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2226784Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774413}
parent ef5fd4e0
......@@ -1776,10 +1776,7 @@ TEST_P(TabletModeControllerScreenshotTest, EnterTabletModeWhileAnimating) {
// Tests that the screenshot is visible when a window animation happens when
// entering tablet mode.
// TODO(http://crbug.com/1035356): This test fails on bots but not locally so
// suspected to be a timing issue. Possible that the screenshot is deleted
// before the waiter is done waiting.
TEST_P(TabletModeControllerScreenshotTest, DISABLED_ScreenshotVisibility) {
TEST_P(TabletModeControllerScreenshotTest, ScreenshotVisibility) {
auto window = CreateTestWindow(gfx::Rect(200, 200));
auto window2 = CreateTestWindow(gfx::Rect(300, 200));
......@@ -1793,6 +1790,13 @@ TEST_P(TabletModeControllerScreenshotTest, DISABLED_ScreenshotVisibility) {
EXPECT_FALSE(IsScreenshotShown());
EXPECT_FALSE(IsShelfOpaque());
EXPECT_FALSE(window2->layer()->GetAnimator()->is_animating());
// The layer we observer is actually the windows layer before starting the
// animation. The animation performed is a cross-fade animation which
// copies the window layer to another layer host. So cache them here for
// later use.
ui::Layer* old_layer = window2->layer();
// Tests that after waiting for the async tablet mode entry, the screenshot is
// shown.
waiter.Wait();
......@@ -1801,6 +1805,7 @@ TEST_P(TabletModeControllerScreenshotTest, DISABLED_ScreenshotVisibility) {
EXPECT_TRUE(IsShelfOpaque());
// Tests that the screenshot is destroyed after the window is done animating.
old_layer->GetAnimator()->StopAnimating();
window2->layer()->GetAnimator()->StopAnimating();
EXPECT_FALSE(IsScreenshotShown());
EXPECT_TRUE(IsShelfOpaque());
......
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