X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Ftest%2Fdata%2Fextensions%2Fapi_test%2Ffile_system_provider%2Fmove_entry%2Ftest.js;h=ef3c530cca5deb732a53bc9266f088d9757faf84;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=99a27b13256e05341d38aa83b93ba8840e86d433;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/test/data/extensions/api_test/file_system_provider/move_entry/test.js b/src/chrome/test/data/extensions/api_test/file_system_provider/move_entry/test.js index 99a27b1..ef3c530 100644 --- a/src/chrome/test/data/extensions/api_test/file_system_provider/move_entry/test.js +++ b/src/chrome/test/data/extensions/api_test/file_system_provider/move_entry/test.js @@ -69,7 +69,7 @@ function onMoveEntryRequested(options, onSuccess, onError) { // Remove the source file. delete test_util.defaultMetadata[options.sourcePath]; - onSuccess(); // enum ProviderError. + onSuccess(); } /** @@ -99,16 +99,15 @@ function runTests() { chrome.test.runTests([ // Move an existing file to a non-existing destination. Should succeed. function moveEntrySuccess() { - var onSuccess = chrome.test.callbackPass(); test_util.fileSystem.root.getFile( TESTING_FILE.name, {create: false}, - function(sourceEntry) { + chrome.test.callbackPass(function(sourceEntry) { chrome.test.assertEq(TESTING_FILE.name, sourceEntry.name); chrome.test.assertFalse(sourceEntry.isDirectory); sourceEntry.moveTo( test_util.fileSystem.root, TESTING_NEW_FILE_NAME, - function(targetEntry) { + chrome.test.callbackPass(function(targetEntry) { chrome.test.assertEq(TESTING_NEW_FILE_NAME, targetEntry.name); chrome.test.assertFalse(targetEntry.isDirectory); // The source file should be deleted. @@ -117,14 +116,13 @@ function runTests() { function(newSourceEntry) { chrome.test.fail('Source file not deleted.'); }, - function(error) { + chrome.test.callbackPass(function(error) { chrome.test.assertEq('NotFoundError', error.name); - onSuccess(); - }); - }, function(error) { + })) + }), function(error) { chrome.test.fail(error.name); }); - }, function(error) { + }), function(error) { chrome.test.fail(error.name); }); }, @@ -132,10 +130,9 @@ function runTests() { // Move an existing file to a location which already holds a file. // Should fail. function moveEntryExistsError() { - var onSuccess = chrome.test.callbackPass(); test_util.fileSystem.root.getFile( TESTING_ANOTHER_FILE.name, {create: false}, - function(sourceEntry) { + chrome.test.callbackPass(function(sourceEntry) { chrome.test.assertEq(TESTING_ANOTHER_FILE.name, sourceEntry.name); chrome.test.assertFalse(sourceEntry.isDirectory); sourceEntry.moveTo( @@ -143,11 +140,10 @@ function runTests() { TESTING_NEW_FILE_NAME, function(targetEntry) { chrome.test.fail('Succeeded, but should fail.'); - }, function(error) { + }, chrome.test.callbackPass(function(error) { chrome.test.assertEq('InvalidModificationError', error.name); - onSuccess(); - }); - }, function(error) { + })); + }), function(error) { chrome.test.fail(error.name); }); }