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

[quickview] Add openQuickViewViaContextMenuSingleSelection test

Add a test checking that Quick View opens from the context menu
when in single selection mode.

Test: browser_tests --gtest_filter="*openQuickViewViaContextMenuSingleSelection"
Bug: 1038799
Change-Id: I569cea5e0ade7f1c9d4a614cfad3bc17d8b88a81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015903
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734489}
parent 0b8add51
...@@ -442,6 +442,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -442,6 +442,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("openQuickViewAndEscape"), TestCase("openQuickViewAndEscape"),
TestCase("openQuickView").InGuestMode(), TestCase("openQuickView").InGuestMode(),
TestCase("openQuickView").TabletMode(), TestCase("openQuickView").TabletMode(),
TestCase("openQuickViewViaContextMenuSingleSelection"),
TestCase("openQuickViewAudio"), TestCase("openQuickViewAudio"),
TestCase("openQuickViewAudioWithImageMetadata"), TestCase("openQuickViewAudioWithImageMetadata"),
TestCase("openQuickViewImage"), TestCase("openQuickViewImage"),
......
...@@ -208,6 +208,42 @@ ...@@ -208,6 +208,42 @@
appId, ['#quick-view', '#open-button[hidden]']); appId, ['#quick-view', '#open-button[hidden]']);
}; };
/**
* Tests that Quick View opens via the context menu with a single selection.
*/
testcase.openQuickViewViaContextMenuSingleSelection = async () => {
// Open Files app on Downloads containing ENTRIES.hello.
const appId =
await setupAndWaitUntilReady(RootPath.DOWNLOADS, [ENTRIES.hello], []);
// Right-click the file in the file-list.
const query = '#file-list [file-name="hello.txt"]';
chrome.test.assertTrue(!!await remoteCall.callRemoteTestUtil(
'fakeMouseRightClick', appId, [query]));
// Wait because WebUI Menu ignores the following click if it happens in
// <200ms from the previous click.
await wait(300);
// Click the file-list context menu "Get info" command.
const getInfoMenuItem = '#file-context-menu:not([hidden]) ' +
' [command="#get-info"]:not([hidden])';
await remoteCall.simulateUiClick(appId, getInfoMenuItem);
// Check: the Quick View dialog should be shown.
const caller = getCaller();
await repeatUntil(async () => {
const query = ['#quick-view', '#dialog[open]'];
const elements = await remoteCall.callRemoteTestUtil(
'deepQueryAllElements', appId, [query, ['display']]);
const haveElements = Array.isArray(elements) && elements.length !== 0;
if (!haveElements || elements[0].styles.display !== 'block') {
return pending(caller, 'Waiting for Quick View to open.');
}
return true;
});
};
/** /**
* Tests opening then closing Quick View on a local downloads file. * Tests opening then closing Quick View on a local downloads file.
*/ */
......
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