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

Unified Diff: chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js

Issue 288263003: Adding more browser tests in copy between windows in file manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modification based on previous CL review. Created 6 years, 7 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 | « chrome/browser/chromeos/file_manager/file_manager_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js
index 341ecde6b6f6fbd148ab88ee3068e338c212b7a5..702e9cb56fe944bc4041454c058ac7c815780dc7 100644
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/copy_between_windows.js
@@ -58,6 +58,82 @@ function copyBetweenWindows(windowId1, windowId2, file) {
var REMOVABLE_VOLUME_QUERY = '#navigation-list > .root-item > ' +
'.volume-icon[volume-type-icon="removable"]';
+testcase.copyBetweenWindowsDriveToLocal = function() {
+ var windowId1;
+ var windowId2;
+ StepsRunner.run([
+ // Make a file in a drive directory.
+ function() {
+ addEntries(['drive'], [ENTRIES.hello], this.next);
+ },
+ // Open windows.
+ function(result) {
+ chrome.test.assertTrue(result);
+ openTwoWindows(RootPath.DRIVE, RootPath.DOWNLOADS).then(this.next);
+ },
+ // Wait for a file in the Drive directory.
+ function(appIds) {
+ windowId1 = appIds[0];
+ windowId2 = appIds[1];
+ waitForFiles(windowId1,
+ [ENTRIES.hello.getExpectedRow()]).then(this.next);
+ },
+ // Copy a file between windows.
+ function() {
+ copyBetweenWindows(windowId1,
+ windowId2,
+ ENTRIES.hello).then(this.next);
+ },
+ function() {
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+};
+
+testcase.copyBetweenWindowsDriveToUsb = function() {
+ var windowId1;
+ var windowId2;
+ StepsRunner.run([
+ // Make a file in a drive directory.
+ function() {
+ addEntries(['drive'], [ENTRIES.hello], this.next);
+ },
+ // Open windows.
+ function(result) {
+ chrome.test.assertTrue(result);
+ openTwoWindows(RootPath.DRIVE, RootPath.DRIVE).then(this.next);
+ },
+ // Wait for a file in the Drive directory.
+ function(appIds) {
+ windowId1 = appIds[0];
+ windowId2 = appIds[1];
+ waitForFiles(windowId1,
+ [ENTRIES.hello.getExpectedRow()]).then(this.next);
+ },
+ // Mount a fake USB volume.
+ function() {
+ chrome.test.sendMessage(JSON.stringify({name: 'mountFakeUsb'}),
+ this.next);
+ },
+ // Wait for the mount.
+ function(result) {
+ waitForElement(windowId2, REMOVABLE_VOLUME_QUERY).then(this.next);
+ },
+ // Click the USB volume.
+ function() {
+ callRemoteTestUtil(
+ 'fakeMouseClick', windowId2, [REMOVABLE_VOLUME_QUERY], this.next);
+ },
+ // Copy a file between windows.
+ function(appIds) {
+ copyBetweenWindows(windowId1, windowId2, ENTRIES.hello).then(this.next);
+ },
+ function() {
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+};
+
testcase.copyBetweenWindowsLocalToDrive = function() {
var windowId1;
var windowId2;
@@ -157,3 +233,44 @@ testcase.copyBetweenWindowsUsbToDrive = function() {
}
]);
};
+
+testcase.copyBetweenWindowsUsbToLocal = function() {
+ var windowId1;
+ var windowId2;
+ StepsRunner.run([
+ // Open windows.
+ function() {
+ openTwoWindows(RootPath.DOWNLOADS, RootPath.DRIVE).then(this.next);
+ },
+ // Mount a fake USB.
+ function(appIds) {
+ windowId1 = appIds[0];
+ windowId2 = appIds[1];
+ chrome.test.sendMessage(JSON.stringify({name: 'mountFakeUsb'}),
+ this.next);
+ },
+ // Add a file to USB.
+ function(result) {
+ chrome.test.assertTrue(JSON.parse(result));
+ addEntries(['usb'], [ENTRIES.hello], this.next);
+ },
+ // Wait for the mount.
+ function(result) {
+ chrome.test.assertTrue(result);
+ waitForElement(windowId1, REMOVABLE_VOLUME_QUERY).then(this.next);
+ },
+ // Click the volume.
+ function() {
+ callRemoteTestUtil(
+ 'fakeMouseClick', windowId1, [REMOVABLE_VOLUME_QUERY], this.next);
+ },
+ // Copy a file between windows.
+ function(appIds) {
+ copyBetweenWindows(windowId1, windowId2, ENTRIES.hello).then(this.next);
+ },
+ function() {
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+};
+
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_manager_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698