Commit 89325a37 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[filesapp] Add a test of html element .pointer-active

Add a test that the html element gains a pointer-active class when the
pointer device (the mouse in our tests) is active.

Test: browser_test --gtest_filter="*keyboardFocusOutlineVisibleMouse*"
Bug: 1062142
Change-Id: Ibd7c3939b4880e5b7cb2364a8b04e4d92d5d3725
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2114012Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752363}
parent 5321036d
......@@ -389,6 +389,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("keyboardCopyDownloads").InGuestMode(),
TestCase("keyboardCopyDownloads"),
TestCase("keyboardCopyDrive"),
TestCase("keyboardFocusOutlineVisibleMouse"),
TestCase("keyboardSelectDriveDirectoryTree"),
TestCase("keyboardDisableCopyWhenDialogDisplayed"),
TestCase("keyboardOpenNewWindow"),
......
......@@ -249,7 +249,6 @@ async function testRenameFolder(path, treeItem) {
await waitForDirectoryTreeItem(appId, 'bbq photos');
}
/**
* Tests renaming a file.
*
......@@ -321,6 +320,31 @@ testcase.renameNewFolderDrive = () => {
return testRenameFolder(RootPath.DRIVE, TREEITEM_DRIVE);
};
/**
* Tests that the root html element .pointer-active class is added and removed
* for mouse interaction.
*/
testcase.keyboardFocusOutlineVisibleMouse = async () => {
// Open Files app.
const appId =
await setupAndWaitUntilReady(RootPath.DOWNLOADS, [ENTRIES.hello], []);
// Send a 'mousedown' to the toolbar 'delete' button.
chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
'fakeEvent', appId, ['#delete-button', 'mousedown']));
// Check: the html element should have a pointer-active class: note use an
// inverted query with waitForElementLost here for speed.
await remoteCall.waitForElementLost(appId, ['html:not(.pointer-active)']);
// Send a 'mouseup' to the toolbar 'delete' button.
chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
'fakeEvent', appId, ['#delete-button', 'mouseup']));
// Check: html element pointer-active class should be removed.
await remoteCall.waitForElementLost(appId, ['html.pointer-active']);
};
/**
* Test that selecting "Google Drive" in the directory tree with the keyboard
* expands it and selects "My Drive".
......
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