Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: ui/file_manager/integration_tests/file_manager/tab_index.js

Issue 1089543005: [Files.app] Added tabindex test for open dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/main.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/integration_tests/file_manager/tab_index.js
diff --git a/ui/file_manager/integration_tests/file_manager/tab_index.js b/ui/file_manager/integration_tests/file_manager/tab_index.js
index 1f43dd165e26d3fe37418f391f3f020adef65ba0..57b9c531bbddc27c3c158d824bc0f305179c8714 100644
--- a/ui/file_manager/integration_tests/file_manager/tab_index.js
+++ b/ui/file_manager/integration_tests/file_manager/tab_index.js
@@ -188,3 +188,67 @@ testcase.tabindexFocusDirectorySelected = function() {
}
]);
};
+
+/**
+ * Tests the tab focus in the dialog and closes the dialog.
+ */
+function tabindexFocus(volumeName, expectedSet, expectedTabOrder) {
+ var localEntriesPromise = addEntries(['local'], BASIC_LOCAL_ENTRY_SET);
+ var driveEntriesPromise = addEntries(['drive'], BASIC_DRIVE_ENTRY_SET);
+ var setupPromise = Promise.all([localEntriesPromise, driveEntriesPromise]);
+
+ var checkAndClose = function(appId) {
+ var promise = remoteCall.callRemoteTestUtil('getActiveElement', appId, []);
+ promise = promise.then(function() {
+ return remoteCall.waitForElement(appId, ['#ok-button:not([disabled])']);
+ });
+
+ // Checks initial focus.
+ promise = promise.then(function() {
+ return remoteCall.waitForElement(appId, ['#file-list:focus']);
+ });
+
+ // Checks tabfocus.
+ expectedTabOrder.forEach(function(className) {
+ promise = promise.then(function() {
+ return remoteCall.checkNextTabFocus(appId, className);
+ }).then(function(result) {
+ chrome.test.assertTrue(result);
+ });
+ });
+
+ promise = promise.then(function() {
+ // Closes the window by pressing Enter.
+ return remoteCall.callRemoteTestUtil(
+ 'fakeKeyDown',
+ appId,
+ ['#file-list', 'Enter', false]);
+ });
+
+ return promise;
+ };
+
+ return setupPromise.then(function() {
+ return openAndWaitForClosingDialog(volumeName, expectedSet, checkAndClose);
+ });
+}
+
+/**
+ * Tests the tab focus behavior of Open Dialog (Downloads).
+ */
+testcase.tabindexOpenDialogDownloads = function() {
+ testPromise(tabindexFocus(
+ 'downloads', BASIC_LOCAL_ENTRY_SET,
+ ['ok-button', 'cancel-button', 'search-button', 'view-button',
+ 'gear-button', 'directory-tree', 'file-list']));
+};
+
+/**
+ * Tests the tab focus behavior of Open Dialog (Drive).
+ */
+testcase.tabindexOpenDialogDrive = function() {
+ testPromise(tabindexFocus(
+ 'drive', BASIC_DRIVE_ENTRY_SET,
+ ['ok-button', 'cancel-button', 'search-button', 'view-button',
+ 'gear-button', 'directory-tree', 'file-list']));
+};
« no previous file with comments | « ui/file_manager/file_manager/main.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698