Index: ui/file_manager/integration_tests/remote_call.js |
diff --git a/ui/file_manager/integration_tests/remote_call.js b/ui/file_manager/integration_tests/remote_call.js |
index 405404dcd50175ecc3aef1f469b532220fa996e1..1f7dd0b6b07f7edc0d04fca9d4c9d54c571d99e8 100644 |
--- a/ui/file_manager/integration_tests/remote_call.js |
+++ b/ui/file_manager/integration_tests/remote_call.js |
@@ -332,6 +332,37 @@ RemoteCallFilesApp.prototype.waitUntilTaskExecutes = |
}; |
/** |
+ * Check if the next tabforcus'd element has the given ID or not. |
+ * @param {string} windowId Target window ID. |
+ * @param {string} elementId String of 'id' attribute which the next tabfocus'd |
+ * element should have. |
+ * @return {Promise} Promise to be fulfilled with the result. |
+ */ |
+RemoteCallFilesApp.prototype.checkNextTabFocus = |
+ function(windowId, elementId) { |
+ return remoteCall.callRemoteTestUtil('fakeKeyDown', |
+ windowId, |
+ ['body', 'U+0009', false]).then( |
+ function(result) { |
+ chrome.test.assertTrue(result); |
+ return remoteCall.callRemoteTestUtil('getActiveElement', |
+ windowId, |
+ []); |
+ }).then(function(element) { |
+ if (!element || !element.attributes['id']) |
+ return false; |
+ |
+ if (element.attributes['id'] === elementId) { |
+ return true; |
+ } else { |
+ console.error('The ID of the element should be "' + elementId + |
+ '", but "' + element.attributes['id'] + '"'); |
+ return false; |
+ } |
+ }); |
+}; |
+ |
+/** |
* Waits until the current directory is changed. |
* @param {string} windowId Target window ID. |
* @param {string} expectedPath Path to be changed to. |