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

Unified Diff: ui/file_manager/integration_tests/remote_call.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
« no previous file with comments | « ui/file_manager/integration_tests/file_manager/tab_index.js ('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/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.
« no previous file with comments | « ui/file_manager/integration_tests/file_manager/tab_index.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698