Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13640112C5 for ; Mon, 15 Sep 2014 22:27:54 +0000 (UTC) Received: (qmail 98438 invoked by uid 500); 15 Sep 2014 22:27:54 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 98411 invoked by uid 500); 15 Sep 2014 22:27:53 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 98397 invoked by uid 99); 15 Sep 2014 22:27:53 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 22:27:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9FF46A1473E; Mon, 15 Sep 2014 22:27:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Message-Id: <13364b88cc7a4f92a4e73498de4b540e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: CB-7423 do cleanup after copyImage manual test Date: Mon, 15 Sep 2014 22:27:53 +0000 (UTC) Repository: cordova-plugin-camera Updated Branches: refs/heads/master fcfe64214 -> 45da41066 CB-7423 do cleanup after copyImage manual test Signed-off-by: Shazron Abdullah Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/45da4106 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/45da4106 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/45da4106 Branch: refs/heads/master Commit: 45da410662bfdaa391dbd722ffd118acd479f474 Parents: fcfe642 Author: Edna Morales Authored: Thu Sep 4 11:04:33 2014 -0400 Committer: Shazron Abdullah Committed: Mon Sep 15 15:27:46 2014 -0700 ---------------------------------------------------------------------- tests/tests.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/45da4106/tests/tests.js ---------------------------------------------------------------------- diff --git a/tests/tests.js b/tests/tests.js index e2ffa9f..e228a93 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -241,10 +241,28 @@ exports.defineManualTests = function (contentEl, createActionButton) { function copyImage() { var onFileSystemReceived = function (fileSystem) { var destDirEntry = fileSystem.root; + var origName = fileEntry.name; // Test FileEntry API here. fileEntry.copyTo(destDirEntry, 'copied_file.png', logCallback('FileEntry.copyTo', true), logCallback('FileEntry.copyTo', false)); fileEntry.moveTo(destDirEntry, 'moved_file.png', logCallback('FileEntry.moveTo', true), logCallback('FileEntry.moveTo', false)); + + //cleanup + //rename moved file back to original name so other tests can reference image + resolveLocalFileSystemURI(destDirEntry.nativeURL+'moved_file.png', function(fileEntry) { + fileEntry.moveTo(destDirEntry, origName, logCallback('FileEntry.moveTo', true), logCallback('FileEntry.moveTo', false)); + console.log('Cleanup: successfully renamed file back to original name'); + }, function () { + console.log('Cleanup: failed to rename file back to original name'); + }); + + //remove copied file + resolveLocalFileSystemURI(destDirEntry.nativeURL+'copied_file.png', function(fileEntry) { + fileEntry.remove(logCallback('FileEntry.remove', true), logCallback('FileEntry.remove', false)); + console.log('Cleanup: successfully removed copied file'); + }, function () { + console.log('Cleanup: failed to remove copied file'); + }); }; window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, onFileSystemReceived, null);