Commit d052db2c authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

[quickview] Add test |deleteItemFromQuickViewSingleSelection|

Add a test that opens a file with Quick View in single-select mode and
deletes it. Checks that the file is deleted, and that Quick View closes.

Bug: 803259
Change-Id: I65200e1aac35d86c64c188e9cc30cc0fa9f73ef1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2026553
Commit-Queue: Isabella Scalzi <isabellascalzi@google.com>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738758}
parent 1f54b5a6
...@@ -482,7 +482,8 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -482,7 +482,8 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("openQuickViewWithMultipleFilesKeyboardUpDown"), TestCase("openQuickViewWithMultipleFilesKeyboardUpDown"),
TestCase("openQuickViewWithMultipleFilesKeyboardLeftRight"), TestCase("openQuickViewWithMultipleFilesKeyboardLeftRight"),
TestCase("closeQuickView"), TestCase("closeQuickView"),
TestCase("openQuickViewFromDirectoryTree"))); TestCase("openQuickViewFromDirectoryTree"),
TestCase("deleteItemFromQuickViewSingleSelection")));
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
DirectoryTree, /* directory_tree.js */ DirectoryTree, /* directory_tree.js */
......
...@@ -2055,4 +2055,34 @@ ...@@ -2055,4 +2055,34 @@
await remoteCall.waitForElement(appId, query.query); await remoteCall.waitForElement(appId, query.query);
} }
}; };
/**
* Tests deleting an item from Quick View when in single select mode, and
* that Quick View closes when there are no more items to view.
*/
testcase.deleteItemFromQuickViewSingleSelection = async () => {
// Open Files app on Downloads containing ENTRIES.hello.
const appId =
await setupAndWaitUntilReady(RootPath.DOWNLOADS, [ENTRIES.hello], []);
// Open the file in Quick View.
await openQuickView(appId, ENTRIES.hello.nameText);
// Press Delete
const deleteKey = ['#quick-view', 'Delete', false, false, false];
chrome.test.assertTrue(
await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, deleteKey),
'Pressing Delete failed.');
// Click the OK button.
const deleteConfirm = ['#quick-view', '.cr-dialog-ok:not([hidden])'];
await remoteCall.waitAndClickElement(appId, deleteConfirm);
// Check: File has been deleted.
await remoteCall.waitForElementLost(
appId, '#file-list [file-name="hello.txt"]');
// Check: Quick View has closed.
await waitQuickViewClose(appId);
};
})(); })();
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