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

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

Issue 1010213006: [Files.app] Add a test to check tabfocus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure Created 5 years, 9 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
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 3b721af03d1a52ad7fd5b84bc8c0a5a414ce414f..f75ca8e1dd3ed45ed38344e063e67369d5a874c3 100644
--- a/ui/file_manager/integration_tests/file_manager/tab_index.js
+++ b/ui/file_manager/integration_tests/file_manager/tab_index.js
@@ -30,8 +30,7 @@ testcase.searchBoxFocus = function() {
function(result) {
chrome.test.assertTrue(result);
remoteCall.waitForElement(appId, ['#search-box input:focus']).
- then(this.next);
- },
+ then(this.next); },
// Press the Esc key.
function(element) {
remoteCall.callRemoteTestUtil('fakeKeyDown',
@@ -50,3 +49,106 @@ testcase.searchBoxFocus = function() {
}
]);
};
+
+/**
+ * Tests the tab focus behavior of Files.app when no file is selected.
+ */
+testcase.tabindexFocus = function() {
+ var appId;
+ StepsRunner.run([
+ // Set up File Manager.
+ function() {
+ setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
+ },
+ // Check that the file list has the focus on launch.
+ function(inAppId) {
+ appId = inAppId;
+ remoteCall.waitForElement(appId, ['#file-list:focus']).then(this.next);
+ },
+ // Press the Tab key.
+ function(element) {
+ remoteCall.callRemoteTestUtil('getActiveElement',
+ appId,
+ [],
+ this.next);
+ }, function(element) {
+ chrome.test.assertEq('list', element.attributes['class']);
+ remoteCall.checkNextTabFocus(appId, 'search-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'view-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'gear-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'directory-tree').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'drive-welcome-link').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'file-list').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+};
+
+/**
+ * Tests the tab focus behavior of Files.app when a directory is selected.
+ */
+testcase.tabindexFocusDirectorySelected = function() {
+ var appId;
+ StepsRunner.run([
+ // Set up File Manager.
+ function() {
+ setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
+ },
+ // Check that the file list has the focus on launch.
+ function(inAppId) {
+ appId = inAppId;
+ remoteCall.waitForElement(appId, ['#file-list:focus']).then(this.next);
+ },
+ // Press the Tab key.
+ function(element) {
+ remoteCall.callRemoteTestUtil('getActiveElement',
+ appId,
+ [],
+ this.next);
+ }, function(element) {
+ chrome.test.assertEq('list', element.attributes['class']);
+ // Select the directory named 'photos'.
+ remoteCall.callRemoteTestUtil(
+ 'selectFile', appId, ['photos']).then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'share-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'delete-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'search-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'view-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'gear-button').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'directory-tree').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'drive-welcome-link').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.checkNextTabFocus(appId, 'file-list').then(this.next);
+ }, function(result) {
+ chrome.test.assertTrue(result);
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+};
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/ui/banners.js ('k') | ui/file_manager/integration_tests/remote_call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698