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

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

Issue 304683002: Add the browser test for the new gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. 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
Index: chrome/test/data/extensions/api_test/file_manager_browsertest/transfer.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/transfer.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/transfer.js
deleted file mode 100644
index 40401c4b4978709febb8a45e8e7554309156f728..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/transfer.js
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-'use strict';
-
-/**
- * Test function to copy from the specified source to the specified destination.
- * @param {TestEntryInfo} targetFile TestEntryInfo of target file to be copied.
- * @param {string} srcName Type of source volume. e.g. downloads, drive,
- * drive_recent, drive_shared_with_me, drive_offline.
- * @param {Array.<TestEntryInfo>} srcEntries Expected initial contents in the
- * source volume.
- * @param {string} dstName Type of destination volume.
- * @param {Array.<TestEntryInfo>} dstEntries Expected initial contents in the
- * destination volume.
- */
-function copyBetweenVolumes(targetFile,
- srcName,
- srcEntries,
- dstName,
- dstEntries) {
- var srcContents = TestEntryInfo.getExpectedRows(srcEntries).sort();
- var dstContents = TestEntryInfo.getExpectedRows(dstEntries).sort();
-
- var appId;
- StepsRunner.run([
- // Set up File Manager.
- function() {
- setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
- },
- // Select the source volume.
- function(inAppId) {
- appId = inAppId;
- callRemoteTestUtil(
- 'selectVolume', appId, [srcName], this.next);
- },
- // Wait for the expected files to appear in the file list.
- function(result) {
- chrome.test.assertTrue(result);
- waitForFiles(appId, srcContents).then(this.next);
- },
- // Select the source file.
- function() {
- callRemoteTestUtil(
- 'selectFile', appId, [targetFile.nameText], this.next);
- },
- // Copy the file.
- function(result) {
- chrome.test.assertTrue(result);
- callRemoteTestUtil('execCommand', appId, ['copy'], this.next);
- },
- // Select the destination volume.
- function(result) {
- chrome.test.assertTrue(result);
- callRemoteTestUtil(
- 'selectVolume', appId, [dstName], this.next);
- },
- // Wait for the expected files to appear in the file list.
- function(result) {
- chrome.test.assertTrue(result);
- waitForFiles(appId, dstContents).then(this.next);
- },
- // Paste the file.
- function() {
- callRemoteTestUtil('execCommand', appId, ['paste'], this.next);
- },
- // Wait for the file list to change.
- function(result) {
- chrome.test.assertTrue(result);
- var ignoreFileSize =
- srcName == 'drive_shared_with_me' ||
- srcName == 'drive_offline' ||
- dstName == 'drive_shared_with_me' ||
- dstName == 'drive_offline';
- var dstContentsAfterPaste = dstContents.slice();
- var pasteFile = targetFile.getExpectedRow();
- for (var i = 0; i < dstContentsAfterPaste.length; i++) {
- if (dstContentsAfterPaste[i][0] === pasteFile[0]) {
- // Replace the last '.' in filename with ' (1).'.
- // e.g. 'my.note.txt' -> 'my.note (1).txt'
- pasteFile[0] = pasteFile[0].replace(/\.(?=[^\.]+$)/, ' (1).');
- break;
- }
- }
- dstContentsAfterPaste.push(pasteFile);
- waitForFiles(appId, dstContentsAfterPaste, {
- ignoreFileSize: ignoreFileSize,
- ignoreLastModifiedTime: true
- }).then(this.next);
- },
- // Check the last contents of file list.
- function() {
- checkIfNoErrorsOccured(this.next);
- }
- ]);
-}
-
-/**
- * Tests copy from drive's root to local's downloads.
- */
-testcase.transferFromDriveToDownloads = copyBetweenVolumes.bind(
- null,
- ENTRIES.hello,
- 'drive',
- BASIC_DRIVE_ENTRY_SET,
- 'downloads',
- BASIC_LOCAL_ENTRY_SET);
-
-/**
- * Tests copy from local's downloads to drive's root.
- */
-testcase.transferFromDownloadsToDrive = copyBetweenVolumes.bind(
- null,
- ENTRIES.hello,
- 'downloads',
- BASIC_LOCAL_ENTRY_SET,
- 'drive',
- BASIC_DRIVE_ENTRY_SET);
-
-/**
- * Tests copy from drive's shared_with_me to local's downloads.
- */
-testcase.transferFromSharedToDownloads = copyBetweenVolumes.bind(
- null,
- ENTRIES.testSharedDocument,
- 'drive_shared_with_me',
- SHARED_WITH_ME_ENTRY_SET,
- 'downloads',
- BASIC_LOCAL_ENTRY_SET);
-
-/**
- * Tests copy from drive's shared_with_me to drive's root.
- */
-testcase.transferFromSharedToDrive = copyBetweenVolumes.bind(
- null,
- ENTRIES.testSharedDocument,
- 'drive_shared_with_me',
- SHARED_WITH_ME_ENTRY_SET,
- 'drive',
- BASIC_DRIVE_ENTRY_SET);
-
-/**
- * Tests copy from drive's recent to local's downloads.
- */
-testcase.transferFromRecentToDownloads = copyBetweenVolumes.bind(
- null,
- ENTRIES.hello,
- 'drive_recent',
- RECENT_ENTRY_SET,
- 'downloads',
- BASIC_LOCAL_ENTRY_SET);
-
-/**
- * Tests copy from drive's recent to drive's root.
- */
-testcase.transferFromRecentToDrive = copyBetweenVolumes.bind(
- null,
- ENTRIES.hello,
- 'drive_recent',
- RECENT_ENTRY_SET,
- 'drive',
- BASIC_DRIVE_ENTRY_SET);
-
-/**
- * Tests copy from drive's offline to local's downloads.
- */
-testcase.transferFromOfflineToDownloads = copyBetweenVolumes.bind(
- null,
- ENTRIES.testDocument,
- 'drive_offline',
- OFFLINE_ENTRY_SET,
- 'downloads',
- BASIC_LOCAL_ENTRY_SET);
-
-/**
- * Tests copy from drive's offline to drive's root.
- */
-testcase.transferFromOfflineToDrive = copyBetweenVolumes.bind(
- null,
- ENTRIES.testDocument,
- 'drive_offline',
- OFFLINE_ENTRY_SET,
- 'drive',
- BASIC_DRIVE_ENTRY_SET);

Powered by Google App Engine
This is Rietveld 408576698