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

Unified Diff: chrome/test/data/extensions/api_test/file_system_provider/add_watcher/test.js

Issue 985533004: Implement chrome.fileSystem.requestFileSystem(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed kiosk mode. Created 5 years, 9 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_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);
});

Powered by Google App Engine
This is Rietveld 408576698