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

[dragdrop] Update transferDragAndHover test

CL:2279301 added specific tests for USB drives so convert DragAndHover
to a hover test that checks that drag hover navigates the file list.

Bug: 1002394
Change-Id: Ic236d9e9255503553379d5995127e4ff453836f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279266Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785259}
parent d7ed5dcc
...@@ -843,36 +843,38 @@ testcase.transferDragAndDrop = async () => { ...@@ -843,36 +843,38 @@ testcase.transferDragAndDrop = async () => {
{ignoreLastModifiedTime: true}); {ignoreLastModifiedTime: true});
}; };
/** /*
* Tests that we can drag a file from #file-list and hover above USB root as * Tests that dragging a file over a directory tree item (folder) navigates
* EntryList without raising an error. * the file list to that folder.
*/ */
testcase.transferDragAndHover = async () => { testcase.transferDragAndHover = async () => {
const entries = [ENTRIES.hello, ENTRIES.photos]; const entries = [ENTRIES.hello, ENTRIES.photos];
await sendTestMessage({name: 'mountUsbWithPartitions'});
await sendTestMessage({name: 'mountFakeUsb'});
// Open files app. // Open files app.
const appId = await setupAndWaitUntilReady(RootPath.DOWNLOADS, entries, []); const appId = await setupAndWaitUntilReady(RootPath.DOWNLOADS, entries, []);
// Drag has to start in the file list column "name" text content, otherwise it // Expand Downloads to display "photos" folder in the directory tree.
// starts a selection instead of a drag. await expandTreeItem(appId, '#directory-tree [entry-label="Downloads"]');
const src =
// The drag has to start in the file list column "name" text, otherwise it
// starts a drag-selection instead of a drag operation.
const source =
`#file-list li[file-name="${ENTRIES.hello.nameText}"] .entry-name`; `#file-list li[file-name="${ENTRIES.hello.nameText}"] .entry-name`;
const dst1 = '#directory-tree [entry-label="Drive Label"]';
const dst2 = '#directory-tree [entry-label="fake-usb"]';
// Wait for USB roots to be ready. // Wait for the directory tree target.
await remoteCall.waitForElement(appId, dst1); const target = '#directory-tree [entry-label="photos"]';
await remoteCall.waitForElement(appId, dst2); await remoteCall.waitForElement(appId, target);
// Drag and hover it. // Drag the source and hover it over the target.
const skipDrop = true; const skipDrop = true;
chrome.test.assertTrue( chrome.test.assertTrue(
await remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil(
'fakeDragAndDrop', appId, [src, dst1, skipDrop]), 'fakeDragAndDrop', appId, [source, target, skipDrop]),
'fakeDragAndDrop failed'); 'fakeDragAndDrop failed');
// Check: drag hovering should navigate the file list.
await remoteCall.waitUntilCurrentDirectoryIsChanged(
appId, '/My files/Downloads/photos');
}; };
/** /**
......
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