Commit ab9566ef authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[dragdrop] Update transferDragAndDrop test

Update comments, variable names and so on to match the other drag drop
transfer tests.

Bug: 1002394
Change-Id: Ib7dd624d649be19ef4043358ea8939e14f3106a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2280757Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785256}
parent a136fdec
...@@ -799,8 +799,8 @@ testcase.transferDragFileListItemSelects = async () => { ...@@ -799,8 +799,8 @@ testcase.transferDragFileListItemSelects = async () => {
}; };
/** /**
* Tests that we can drag a file from #file-list to #directory-tree. * Tests that dropping a file on a directory tree item (folder) copies the
* It copies the file from Downloads to Downloads/photos. * file to that folder.
*/ */
testcase.transferDragAndDrop = async () => { testcase.transferDragAndDrop = async () => {
const entries = [ENTRIES.hello, ENTRIES.photos]; const entries = [ENTRIES.hello, ENTRIES.photos];
...@@ -811,34 +811,33 @@ testcase.transferDragAndDrop = async () => { ...@@ -811,34 +811,33 @@ testcase.transferDragAndDrop = async () => {
// Expand Downloads to display "photos" folder in the directory tree. // Expand Downloads to display "photos" folder in the directory tree.
await expandTreeItem(appId, '#directory-tree [entry-label="Downloads"]'); await expandTreeItem(appId, '#directory-tree [entry-label="Downloads"]');
// Drag has to start in the file list column "name" text content, otherwise it // The drag has to start in the file list column "name" text, otherwise it
// starts a selection instead of a drag. // starts a drag-selection instead of a drag operation.
const src = const source =
`#file-list li[file-name="${ENTRIES.hello.nameText}"] .entry-name`; `#file-list li[file-name="${ENTRIES.hello.nameText}"] .entry-name`;
const dst = '#directory-tree [entry-label="photos"]';
// Select the file to be dragged. // Wait for the source.
chrome.test.assertTrue( await remoteCall.waitForElement(appId, source);
await remoteCall.callRemoteTestUtil('fakeMouseClick', appId, [src]),
'fakeMouseClick failed'); // Wait for the directory tree target.
const target = '#directory-tree [entry-label="photos"]';
await remoteCall.waitForElement(appId, target);
// Drag and drop it. // Drag the source and drop it on the target.
const skipDrop = false; const skipDrop = false;
chrome.test.assertTrue( chrome.test.assertTrue(
await remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil(
'fakeDragAndDrop', appId, [src, dst, skipDrop]), 'fakeDragAndDrop', appId, [source, target, skipDrop]),
'fakeDragAndDrop failed'); 'fakeDragAndDrop failed');
// Navigate to the dst folder. // Navigate the file list to the target.
chrome.test.assertTrue( await remoteCall.waitAndClickElement(appId, target);
!!await remoteCall.callRemoteTestUtil('fakeMouseClick', appId, [dst]),
'fakeMouseClick failed');
// Wait for navigation to finish. // Wait for navigation to finish.
await remoteCall.waitUntilCurrentDirectoryIsChanged( await remoteCall.waitUntilCurrentDirectoryIsChanged(
appId, '/My files/Downloads/photos'); appId, '/My files/Downloads/photos');
// Wait for the expected files to appear in the file list. // Check: the dropped file should appear in the file list.
await remoteCall.waitForFiles( await remoteCall.waitForFiles(
appId, TestEntryInfo.getExpectedRows([ENTRIES.hello]), appId, TestEntryInfo.getExpectedRows([ENTRIES.hello]),
{ignoreLastModifiedTime: true}); {ignoreLastModifiedTime: true});
......
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