New issue
Advanced search Search tips

Issue 890633 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ExtendedDesktopTest.PassiveGrab makes invalid assertions and is brittle when shelf width changes

Project Member Reported by jamescook@chromium.org, Sep 30

Issue description

I'm working on a CL that adds a text button to the status area when feature SingleProcessMash. See  issue 890400  and CL https://crrev.com/c/1252632. This changes the shelf view's available width. Strangely, this causes ExtendedDesktopTest.PassiveGrab to fail.

The test verifies that ui::test::EventGenerator correctly "grabs" the mouse during a click-and-drag across multiple monitors. Oshima added it in https://chromiumcodereview.appspot.com/11691010/

I notice it contains this assertion:

  UpdateDisplay("300x300,200x200");
  views::Widget* widget = CreateTestWidget(gfx::Rect(50, 50, 200, 200));
  widget->Show();
  ASSERT_EQ("50,44 200x200", widget->GetWindowBoundsInScreen().ToString());
                ^^
This is clearly wrong - the widget's Y position should not be 44 immediately after creation.

There is also a later assertion about the mouse position after it moves to the second display:

  generator->MoveMouseTo(400, 150);
  EXPECT_EQ("100,6 100,150", event_handler.GetLocationsAndReset());
                 ^
This is also wrong. The mouse's Y position should be 100.

These assertions used to contain the values I expect. However, manucornet changed the assertions in this CL that enabled the new shelf:
https://chromium-review.googlesource.com/c/chromium/src/+/1188848

Something in the new shelf code is breaking either:

* Widget size
* Display work area
* Event targeting

We should either figure out what's broken in the new shelf. In the short term we need to make this test less brittle such that unrelated changes don't break the hard-coded values.

 
Actually, the first problem is simple. The display work area for a 300x300 display is 300x244 with the new shelf. The widget no longer fits on the display (its bottom is at 250) and so the widget is moved during creation.

Description: Show this description
Looks like that was because shelf height has been increased from 48 to 56.
It's a major change that affects many part of desktop UI so I'd expect that many tests had to be updated.

Thank you for taking care of fixing it.


Project Member

Comment 4 by bugdroid1@chromium.org, Oct 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9d729a83602c8f46cadd2404af01ee8e189deee1

commit 9d729a83602c8f46cadd2404af01ee8e189deee1
Author: James Cook <jamescook@chromium.org>
Date: Mon Oct 01 15:35:44 2018

chromeos: Clean up ExtendedDesktopTest.PassiveGrab

The assertions were unclear because the test window was being created
partially outside the display work area, resulting in it being moved
from its initial coordinates.

Make the simulated display bigger so the window isn't moved.
Clarify and document the expectations.

Bug:  890633 
Test: ash_unittests
Change-Id: Ie0ba065bc4d8f46a2cfd6ad24250d808845e8cd5
Reviewed-on: https://chromium-review.googlesource.com/1252384
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595456}
[modify] https://crrev.com/9d729a83602c8f46cadd2404af01ee8e189deee1/ash/extended_desktop_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment