Commit 243744c2 authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

Potential fix for flaky test openQuickViewViaContextMenuSingleSelection

Use |fakeMouseClick| instead of |simulateUiClick| and select the file
to open the context menu on using |selectFile| rather than relying on
right clicking.

Also change |openQuickViewViaContextMenuCheckSelections| to use
|fakeMouseClick| as well to see if |simulateUiClick| is the cause.

Bug: 1038799
Change-Id: I7de92609e061b62bc351cfb4a5bef3eb0965a21a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2026548
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736223}
parent ee8ae33b
...@@ -212,9 +212,15 @@ ...@@ -212,9 +212,15 @@
* Tests that Quick View opens via the context menu with a single selection. * Tests that Quick View opens via the context menu with a single selection.
*/ */
testcase.openQuickViewViaContextMenuSingleSelection = async () => { testcase.openQuickViewViaContextMenuSingleSelection = async () => {
// Open Files app on Downloads containing ENTRIES.hello. // Open Files app on Downloads containing BASIC_LOCAL_ENTRY_SET.
const appId = const appId = await setupAndWaitUntilReady(
await setupAndWaitUntilReady(RootPath.DOWNLOADS, [ENTRIES.hello], []); RootPath.DOWNLOADS, BASIC_LOCAL_ENTRY_SET, []);
// Select hello.txt in the file list.
chrome.test.assertTrue(
!!await remoteCall.callRemoteTestUtil(
'selectFile', appId, [ENTRIES.hello.nameText]),
'selectFile failed');
// Right-click the file in the file-list. // Right-click the file in the file-list.
const query = '#file-list [file-name="hello.txt"]'; const query = '#file-list [file-name="hello.txt"]';
...@@ -228,7 +234,8 @@ ...@@ -228,7 +234,8 @@
// Click the file-list context menu "Get info" command. // Click the file-list context menu "Get info" command.
const getInfoMenuItem = '#file-context-menu:not([hidden]) ' + const getInfoMenuItem = '#file-context-menu:not([hidden]) ' +
' [command="#get-info"]:not([hidden])'; ' [command="#get-info"]:not([hidden])';
await remoteCall.simulateUiClick(appId, getInfoMenuItem); await remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, [getInfoMenuItem]);
// Check: the Quick View dialog should be shown. // Check: the Quick View dialog should be shown.
const caller = getCaller(); const caller = getCaller();
...@@ -269,7 +276,8 @@ ...@@ -269,7 +276,8 @@
// Click the file-list context menu "Get info" command. // Click the file-list context menu "Get info" command.
const getInfoMenuItem = '#file-context-menu:not([hidden]) ' + const getInfoMenuItem = '#file-context-menu:not([hidden]) ' +
' [command="#get-info"]:not([hidden])'; ' [command="#get-info"]:not([hidden])';
await remoteCall.simulateUiClick(appId, getInfoMenuItem); await remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, [getInfoMenuItem]);
// Check: the Quick View dialog should be shown. // Check: the Quick View dialog should be shown.
const caller = getCaller(); const caller = getCaller();
......
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