• Lukasz Anforowicz's avatar
    Stop relying on ExtensionActionTestHelper::GetPopupSize in tests. · 3b12c280
    Lukasz Anforowicz authored
    The only test (BrowserAction*Test.BrowserActionPopup) that used to rely
    on ExtensionActionTestHelper::GetPopupSize was disabled for a long time.
    In the meantime, GetPopupSize stopped working (e.g. it would crash with
    a null dereference when not being able to find a native widget
    associated with the popup).
    
    This CL re-enables the test (the focus-related flakiness should be fixed
    by r754788) and makes the test use
    content::WebContents::GetContainerBounds instead of
    ExtensionActionTestHelper::GetPopupSize.  After this CL, the
    GetPopupSize helper test method is no longer needed and can be removed.
    
    Additionally, the CL removes one additional cause of test flakiness by
    making sure that the resizing of the popup has actually propagated all
    the way to the content::WebContents::GetContainerBounds by 1) waiting
    until layout happens (by having the test go through
    requestAnimationFrame) and 2) by waiting until the layout results have
    gone through compositing (by having the test wait for
    MainThreadFrameObserver).
    
    Bug: 1021172
    Change-Id: I84cdd6934d621dfed9ec783fbd0e21d172387fee
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129211
    Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#755886}
    3b12c280
extension_action_test_helper.h 3.96 KB