Commit 77e1b616 authored by Rachel Sugrono's avatar Rachel Sugrono Committed by Commit Bot

[QuickView] Fix comment nits in quick_view.js

Bug: 907380
Change-Id: I3d8c4d1c4457b6ee9a11d58fe23ce6402e4d6805
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1994022
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730064}
parent 17dc939b
...@@ -1261,7 +1261,8 @@ ...@@ -1261,7 +1261,8 @@
}; };
/** /**
* Tests checking the tabbing on jpeg files in Quick View. * Tests the tab-index focus order when sending tab keys when an image file is
* shown in Quick View.
*/ */
testcase.openQuickViewTabIndexImage = async () => { testcase.openQuickViewTabIndexImage = async () => {
const caller = getCaller(); const caller = getCaller();
...@@ -1280,7 +1281,7 @@ ...@@ -1280,7 +1281,7 @@
// Open the file in Quick View. // Open the file in Quick View.
await openQuickView(appId, ENTRIES.smallJpeg.nameText); await openQuickView(appId, ENTRIES.smallJpeg.nameText);
// Prepare a list of tab-index queries. // Prepare a list of tab-index focus queries.
const tabQueries = [ const tabQueries = [
{'query': ['#quick-view', '[aria-label="Back"]:focus']}, {'query': ['#quick-view', '[aria-label="Back"]:focus']},
{'query': ['#quick-view', '[aria-label="Open"]:focus']}, {'query': ['#quick-view', '[aria-label="Open"]:focus']},
...@@ -1288,17 +1289,17 @@ ...@@ -1288,17 +1289,17 @@
{'query': ['#quick-view', '[aria-label="Back"]:focus']}, {'query': ['#quick-view', '[aria-label="Back"]:focus']},
]; ];
// Hit tab key to focus on the element.
for (const query of tabQueries) { for (const query of tabQueries) {
// Make the browser dispatch a tab key event to FilesApp.
const result = await sendTestMessage( const result = await sendTestMessage(
{name: 'dispatchTabKey', shift: query.shift || false}); {name: 'dispatchTabKey', shift: query.shift || false});
chrome.test.assertEq( chrome.test.assertEq(
result, 'tabKeyDispatched', 'Tab key dispatch failure'); result, 'tabKeyDispatched', 'Tab key dispatch failure');
// Wait until we get the focus on the element // Wait until we get the focus on the element.
await remoteCall.waitForElement(appId, query.query); await remoteCall.waitForElement(appId, query.query);
// Make sure the events are handled correctly. // Ensure all events have been processed before continuing.
chrome.test.assertTrue(await remoteCall.callRemoteTestUtil( chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
'requestAnimationFrame', appId, [])); 'requestAnimationFrame', 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