New issue
Advanced search Search tips

Issue 891080 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug


Show other hotlists

Hotlists containing this issue:
Launcher-Broken


Sign in to add a comment

ShelfView::last_visible_index_ is sometimes wrong, test failures in ShelfViewTest and ShelfViewOverflowFocusTest

Project Member Reported by jamescook@chromium.org, Oct 1

Issue description

I recently wrote a CL that adds a text-only button to the status area when running with --enable-features=SingleProcessMash. To my surprise this caused a variety of unit test failures, including:

ShelfViewTest.ShelfRipOff
ShelfViewOverflowFocusTest.Basic
ShelfViewOverflowFocusTest.ForwardCyclingWithBubbleOpen

My code changes the width of the ShelfView, but it does so in a way identical to LogoutButtonTray, which we use in production.

shelf_view.h has a diagram showing that ShelfView::last_visible_index() should match the overflow shelf's first_visible_index(). That isn't true for some shelf widths.

I wrote a test CL to demonstrate the problem:
https://chromium-review.googlesource.com/c/chromium/src/+/1253077

At certain shelf widths ShelfView::last_visible_index_ goes backwards when the overflow bubble appears. According to the diagram in shelf_view.h that shouldn't happen.

I can also see this happening when running chrome, especially if I make the desktop window very narrow.

sammiequon added the overflow focus tests recently:
https://chromium-review.googlesource.com/1125317

manucornet's CL here made some changes to last_visible_index_ computation:
https://chromium-review.googlesource.com/c/chromium/src/+/1150776

manucornet's CL here commented out some overflow-bubble test expectations that are similar to the failures I'm seeing:
https://chromium-review.googlesource.com/c/chromium/src/+/1188848

Commented out expectations:
https://cs.chromium.org/chromium/src/ash/shelf/shelf_view_unittest.cc?sq=package:chromium&g=0&l=909

I think something is wrong in last_visible_index computation, maybe only in tests, but maybe in production as well.

Manu, could you investigate?

 
I wrote a test that asserts ShelfView::last_visible_index_ shouldn't change when adding app shortcuts after the overflow button is already visible:

https://chromium-review.googlesource.com/c/chromium/src/+/1257890

git bisect shows that the test starts failing with this CL:

6442a85088c64c17db646374c94e78cca6f19b99 is the first bad commit
commit 6442a85088c64c17db646374c94e78cca6f19b99
Author: Manu Cornet <manucornet@chromium.org>
Date:   Wed Aug 29 08:01:03 2018 +0000

    CrOS shelf: switch to feature mechanism and enable by default
    
    Fix a lot of tests that hardcode the size of the shelf.
    
    Bug: 871846
    Change-Id: I586da09835f03beb3e92712fbf32ebefd521a5d5
    Reviewed-on: https://chromium-review.googlesource.com/1188848
    Commit-Queue: Manu Cornet <manucornet@chromium.org>
    Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
    Reviewed-by: Alex Newcomer <newcomer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#587038}

Hey Manu, would you mind giving James a hand diagnosing the new shelf code? Thanks!
I'm OoO for a few days, but will be glad to do that when I'm back!
Labels: M-73

Sign in to add a comment