| Index: chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js
|
| diff --git a/chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js b/chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js
|
| index 54a023cdee0999908a9bbddfea715edf621768d3..752b316bdd30d2b67e91300fddbe5fe58532af69 100644
|
| --- a/chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js
|
| +++ b/chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js
|
| @@ -85,21 +85,26 @@ function runTests() {
|
| {create: false},
|
| chrome.test.callbackPass(function(fileEntry) {
|
| chrome.test.assertEq(TESTING_FILE.name, fileEntry.name);
|
| - chrome.fileManagerPrivate.addFileWatch(
|
| - fileEntry.toURL(),
|
| - chrome.test.callbackPass(function(result) {
|
| - chrome.test.assertTrue(result);
|
| - chrome.fileSystemProvider.getAll(
|
| - chrome.test.callbackPass(function(fileSystems) {
|
| - chrome.test.assertEq(1, fileSystems.length);
|
| - chrome.test.assertEq(1, fileSystems[0].watchers.length);
|
| - var watcher = fileSystems[0].watchers[0];
|
| - chrome.test.assertEq(
|
| - '/' + TESTING_FILE.name, watcher.entryPath);
|
| - chrome.test.assertFalse(watcher.recursive);
|
| - chrome.test.assertEq(undefined, watcher.tag);
|
| + test_util.toExternalEntry(fileEntry).then(
|
| + chrome.test.callbackPass(function(externalEntry) {
|
| + chrome.test.assertTrue(!!externalEntry);
|
| + chrome.fileManagerPrivate.addFileWatch(
|
| + externalEntry.toURL(),
|
| + chrome.test.callbackPass(function(result) {
|
| + chrome.test.assertTrue(result);
|
| + chrome.fileSystemProvider.getAll(
|
| + chrome.test.callbackPass(function(fileSystems) {
|
| + chrome.test.assertEq(1, fileSystems.length);
|
| + chrome.test.assertEq(
|
| + 1, fileSystems[0].watchers.length);
|
| + var watcher = fileSystems[0].watchers[0];
|
| + chrome.test.assertEq(
|
| + '/' + TESTING_FILE.name, watcher.entryPath);
|
| + chrome.test.assertFalse(watcher.recursive);
|
| + chrome.test.assertEq(undefined, watcher.tag);
|
| + }));
|
| }));
|
| - }));
|
| + })).catch(chrome.test.fail);
|
| }), function(error) {
|
| chrome.test.fail(error.name);
|
| });
|
| @@ -113,16 +118,22 @@ function runTests() {
|
| {create: false},
|
| chrome.test.callbackPass(function(fileEntry) {
|
| chrome.test.assertEq(TESTING_FILE.name, fileEntry.name);
|
| - chrome.fileManagerPrivate.addFileWatch(
|
| - fileEntry.toURL(),
|
| - chrome.test.callbackFail('Unknown error.', function(result) {
|
| - chrome.test.assertFalse(result);
|
| - chrome.fileSystemProvider.getAll(
|
| - chrome.test.callbackPass(function(fileSystems) {
|
| - chrome.test.assertEq(1, fileSystems.length);
|
| - chrome.test.assertEq(1, fileSystems[0].watchers.length);
|
| + test_util.toExternalEntry(fileEntry).then(
|
| + chrome.test.callbackPass(function(externalEntry) {
|
| + chrome.test.assertTrue(!!externalEntry);
|
| + chrome.fileManagerPrivate.addFileWatch(
|
| + fileEntry.toURL(),
|
| + chrome.test.callbackFail(
|
| + 'Unknown error.', function(result) {
|
| + chrome.test.assertFalse(!!result);
|
| + chrome.fileSystemProvider.getAll(
|
| + chrome.test.callbackPass(function(fileSystems) {
|
| + chrome.test.assertEq(1, fileSystems.length);
|
| + chrome.test.assertEq(
|
| + 1, fileSystems[0].watchers.length);
|
| + }));
|
| }));
|
| - }));
|
| + })).catch(chrome.test.fail);
|
| }), function(error) {
|
| chrome.test.fail(error.name);
|
| });
|
| @@ -135,16 +146,22 @@ function runTests() {
|
| {create: false},
|
| chrome.test.callbackPass(function(fileEntry) {
|
| chrome.test.assertEq(TESTING_BROKEN_FILE.name, fileEntry.name);
|
| - chrome.fileManagerPrivate.addFileWatch(
|
| - fileEntry.toURL(),
|
| - chrome.test.callbackFail('Unknown error.', function(result) {
|
| - chrome.test.assertFalse(result);
|
| - chrome.fileSystemProvider.getAll(
|
| - chrome.test.callbackPass(function(fileSystems) {
|
| - chrome.test.assertEq(1, fileSystems.length);
|
| - chrome.test.assertEq(1, fileSystems[0].watchers.length);
|
| - }));
|
| - }));
|
| + test_util.toExternalEntry(fileEntry).then(
|
| + chrome.test.callbackPass(function(externalEntry) {
|
| + chrome.test.assertTrue(!!externalEntry);
|
| + chrome.fileManagerPrivate.addFileWatch(
|
| + fileEntry.toURL(),
|
| + chrome.test.callbackFail(
|
| + 'Unknown error.', function(result) {
|
| + chrome.test.assertFalse(!!result);
|
| + chrome.fileSystemProvider.getAll(
|
| + chrome.test.callbackPass(function(fileSystems) {
|
| + chrome.test.assertEq(1, fileSystems.length);
|
| + chrome.test.assertEq(
|
| + 1, fileSystems[0].watchers.length);
|
| + }));
|
| + }));
|
| + })).catch(chrome.test.fail);
|
| }), function(error) {
|
| chrome.test.fail(error.name);
|
| });
|
|
|