• Joel Hockey's avatar
    Reland "CrOS FilesApp: Share crostini entries before opening" · a26513fe
    Joel Hockey authored
    This is a reland of dec38a71
    
    Failure was flaking in test FileManagerUITest.Crostini which was
    caused by dialogs not being fully cleared before a new dialog
    was being shown.
    
    This is fixed by changing the test code to wait for the dialog
    elements to be fully removed from the dom:
      assertTrue(test.fakeMouseClick('button.cr-dialog-ok'));
      test.waitForElementLost('.cr-dialog-container');
    rather than just waiting for the .shown class to be removed:
      assertTrue(test.fakeMouseClick('button.cr-dialog-ok'));
      test.waitForElementLost('.cr-dialog-container.shown')
    
    The behaviour that we were getting was:
    1/ show dialog1: adds div.cr-dialog-container.shown to body
    2/ test clicks on OK button to close dialog1.
    3a/ dialog1 div.cr-dialog-container removes .shown attr
       The removal of the dialog div is delayed by design.
    4/ next test show dialog2: 2nd div.cr-dialog-container added to body
    5/ test clicks on OK button to close dialog2, but actually
       ends up clicking on dialog1
    6/ Error at https://cs.chromium.org/chromium/src/ui/webui/resources/js/cr/ui/dialogs.js?l=262&rcl=e20c6e8387cdccf61eef8615ac2b3b0a582b156b
    3b/ dialog1 div finally removed from dom.
    
    
    Original change's description:
    > CrOS FilesApp: Share crostini entries before opening
    >
    > When a user opens files within Downloads using a crostini app,
    > show a dialog for the user to give permission to share the
    > directory that the files are in with crostini.
    >
    > * Move handling of 'crostin-files' flag checking into
    >   foreground/js/crostini.js
    > * Change FileTasks.executeInternal to detect files that
    >   can be shared with crostini and do sharing before execute.
    > * UI Test verifies share dialog is shown before execute.
    > * ConvertFileSystemURLToPathInsideCrostini maps
    >   path from within Downloads to '/ChromeOS/Downloads/...'
    >
    > Bug: 878324
    > Change-Id: Ie88090ff958dd201aeacb23fdfcc84a4f3d20210
    > Reviewed-on: https://chromium-review.googlesource.com/c/1243871
    > Reviewed-by: Nicholas Verne <nverne@chromium.org>
    > Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
    > Commit-Queue: Joel Hockey <joelhockey@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#596003}
    
    Bug: 878324
    Change-Id: Ied6225dca13a244ebbdbfa291fdd789d762ee140
    Tbr: nverne@chromium.org
    Reviewed-on: https://chromium-review.googlesource.com/c/1258683
    Commit-Queue: Joel Hockey <joelhockey@chromium.org>
    Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#596109}
    a26513fe
file_manager_strings.grdp 81.5 KB