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

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

Issue 1373733002: Reland: Files.app: add create directory operation to context menu of directory tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix flaky test cases. Created 5 years, 3 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/directory_tree_context_menu.js
diff --git a/ui/file_manager/integration_tests/file_manager/directory_tree_context_menu.js b/ui/file_manager/integration_tests/file_manager/directory_tree_context_menu.js
index 47c6ee8e25aefaff979a7eae8e79b9918f35ad5e..63e0d7140ad9d91dd532f5d6edcd3cacf58e7324 100644
--- a/ui/file_manager/integration_tests/file_manager/directory_tree_context_menu.js
+++ b/ui/file_manager/integration_tests/file_manager/directory_tree_context_menu.js
@@ -110,6 +110,8 @@ function renamePhotosDirectoryTo(windowId, newName, useKeyboardShortcut) {
return clickDirectoryTreeContextMenuItem(windowId, '/photos', 'rename');
}
}).then(function() {
+ return remoteCall.waitForElement(windowId, '.tree-row > input');
+ }).then(function() {
return remoteCall.callRemoteTestUtil(
'inputText', windowId, ['.tree-row > input', newName]);
}).then(function() {
@@ -149,6 +151,44 @@ function renameDirectoryFromDirectoryTreeAndConfirmAlertDialog(newName) {
}
/**
+ * Creates directory from directory tree.
+ */
+function createDirectoryFromDirectoryTree(useKeyboardShortcut) {
+ var windowId;
+ return setupForDirectoryTreeContextMenuTest().then(function(id) {
+ windowId = id;
+ return navigateWithDirectoryTree(windowId, '/photos');
+ }).then(function() {
+ if (useKeyboardShortcut) {
+ return remoteCall.callRemoteTestUtil('fakeKeyDown', windowId,
+ ['body', 'U+0045' /* e */, true /* ctrl */]);
+ } else {
+ return clickDirectoryTreeContextMenuItem(
+ windowId, '/photos', 'new-folder');
+ }
+ }).then(function() {
+ return remoteCall.waitForElement(windowId, '.tree-row > input');
+ }).then(function() {
+ return remoteCall.callRemoteTestUtil(
+ 'inputText', windowId, ['.tree-row > input', 'test']);
+ }).then(function() {
+ return remoteCall.callRemoteTestUtil(
+ 'fakeKeyDown', windowId, ['.tree-row > input', 'Enter', false]);
+ }).then(function() {
+ // Confirm that new directory is added to the directory tree.
+ return remoteCall.waitForElement(
+ windowId, '[full-path-for-testing="/photos/test"]');
+ }).then(function() {
+ // Confirm that current directory is not changed at this timing.
+ return remoteCall.waitUntilCurrentDirectoryIsChanged(
+ windowId, '/Downloads/photos');
+ }).then(function() {
+ // Confirm that new directory is actually created by navigating to it.
+ return navigateWithDirectoryTree(windowId, '/photos/test');
+ });
+}
+
+/**
* Test case for copying a directory from directory tree by using context menu.
*/
testcase.copyFromDirectoryTreeWithContextMenu = function() {
@@ -292,3 +332,20 @@ testcase.renameDirectoryToExistingOneFromDirectoryTree = function() {
testPromise(renameDirectoryFromDirectoryTreeAndConfirmAlertDialog(
'destination'));
};
+
+/**
+ * Test case for creating directory from directory tree by using context menu.
+ */
+testcase.createDirectoryFromDirectoryTreeWithContextMenu = function() {
+ testPromise(createDirectoryFromDirectoryTree(
+ false /* do not use keyboard shortcut */));
+};
+
+/**
+ * Test case for creating directory from directory tree by using keyboard
+ * shortcut.
+ */
+testcase.createDirectoryFromDirectoryTreeWithKeyboardShortcut = function() {
+ testPromise(createDirectoryFromDirectoryTree(
+ true /* use keyboard shortcut */));
+};
« 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