Commit 38e83f2d authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Wait until Files app is fully loaded

Change setupAndWaitUntilReady function to wait until Files app is fully
loaded. This intend to fix flaky tests where tests expect to have Files
app loaded in Downloads folder, however EntryList |updateSubDirectories|
method is being refactored to be asynchronous, which makes Downloads
folder to delay its appearance. This change has had 4 successful runs in
a row in crrev.com/c/1312185 (patchset 2 and 3).

Re-enable test that was flaky on MSAN.

Bug: 899664
Change-Id: Iedff85699c56f6cf8ac82d5ea27ef0ca54b7a641
Reviewed-on: https://chromium-review.googlesource.com/c/1313709Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604740}
parent bf516b22
......@@ -278,10 +278,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
FilesAppBrowserTest,
::testing::Values(TestCase("selectCreateFolderDownloads").InGuestMode(),
TestCase("selectCreateFolderDownloads"),
// This test is flaky in MSAN, disabling until is fixed: crbug.com/899664.
#if !defined(MEMORY_SANITIZER)
TestCase("createFolderDownloads").InGuestMode(),
#endif
TestCase("createFolderDownloads"),
TestCase("createFolderNestedDownloads"),
TestCase("createFolderDrive").DisableDriveFs(),
......
......@@ -972,6 +972,9 @@ DirectoryModel.prototype.changeDirectoryEntry = function(
if (dirEntry instanceof VolumeEntry)
dirEntry = assert(dirEntry.rootEntry);
// TODO(lucmult): Remove this log once flakiness is fixed.
console.log('changeDirectoryEntry: ' + dirEntry.name);
// Increment the sequence value.
this.changeDirectorySequence_++;
this.clearSearch_();
......
......@@ -372,13 +372,16 @@ function setupAndWaitUntilReady(
if (opt_callback)
opt_callback = chrome.test.callbackPass(opt_callback);
let result;
return Promise.all([
windowPromise,
localEntriesPromise,
driveEntriesPromise,
detailedTablePromise
]).then(function(results) {
var result = {windowId: results[0], fileList: results[3]};
result = {windowId: results[0], fileList: results[3]};
return remoteCall.waitFor('isFileManagerLoaded', result.windowId, true);
}).then(() => {
if (opt_callback)
opt_callback(result);
return result;
......
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