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

Unified Diff: chrome/test/data/extensions/api_test/file_system_provider/mime_type/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/mime_type/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/mime_type/test.js b/chrome/test/data/extensions/api_test/file_system_provider/mime_type/test.js
index 2338b6c3042365f90ff3900c17715ade31f8ef68..683ed02fa6fa963168139a82945af1a1abca9c09 100644
--- a/chrome/test/data/extensions/api_test/file_system_provider/mime_type/test.js
+++ b/chrome/test/data/extensions/api_test/file_system_provider/mime_type/test.js
@@ -63,17 +63,20 @@ function runTests() {
TESTING_WITH_MIME_FILE.name,
{},
chrome.test.callbackPass(function(entry) {
- chrome.fileManagerPrivate.getFileTasks(
- [entry.toURL()],
- chrome.test.callbackPass(function(tasks) {
- chrome.test.assertEq(1, tasks.length);
- chrome.test.assertEq(
- 'pkplfbidichfdicaijlchgnapepdginl|app|magic_handler',
- tasks[0].taskId);
- }));
- }), function(error) {
- chrome.test.fail(error.name);
- });
+ test_util.toExternalEntry(entry).then(function(externalEntry) {
+ chrome.test.assertTrue(!!externalEntry);
+ chrome.fileManagerPrivate.getFileTasks(
+ [externalEntry.toURL()],
+ chrome.test.callbackPass(function(tasks) {
+ chrome.test.assertEq(1, tasks.length);
+ chrome.test.assertEq(
+ 'pkplfbidichfdicaijlchgnapepdginl|app|magic_handler',
+ tasks[0].taskId);
+ }));
+ }).catch(chrome.test.fail);
+ }), function(error) {
+ chrome.test.fail(error.name);
+ });
},
// Confirm, that executing that task, will actually run an OnLaunched event.
@@ -83,32 +86,38 @@ function runTests() {
TESTING_WITH_MIME_FILE.name,
{},
chrome.test.callbackPass(function(entry) {
- chrome.fileManagerPrivate.getFileTasks(
- [entry.toURL()],
- chrome.test.callbackPass(function(tasks) {
- chrome.test.assertEq(1, tasks.length);
- chrome.test.assertEq(
- 'pkplfbidichfdicaijlchgnapepdginl|app|magic_handler',
- tasks[0].taskId);
- var onLaunched = function(event) {
- chrome.test.assertTrue(!!event);
- chrome.test.assertEq('magic_handler', event.id);
- chrome.test.assertTrue(!!event.items);
- chrome.test.assertEq(1, event.items.length);
- chrome.test.assertEq(
- TESTING_MIME_TYPE, event.items[0].type);
- chrome.test.assertEq(
- TESTING_WITH_MIME_FILE.name,
- event.items[0].entry.name);
- chrome.app.runtime.onLaunched.removeListener(onLaunched);
- };
- chrome.app.runtime.onLaunched.addListener(onLaunched);
- chrome.fileManagerPrivate.executeTask(
- tasks[0].taskId, [entry.toURL()]);
- }));
- }), function(error) {
- chrome.test.fail(error.name);
- });
+ test_util.toExternalEntry(entry).then(
+ chrome.test.callbackPass(function(externalEntry) {
+ chrome.test.assertTrue(!!externalEntry);
+ chrome.fileManagerPrivate.getFileTasks(
+ [externalEntry.toURL()],
+ chrome.test.callbackPass(function(tasks) {
+ chrome.test.assertEq(1, tasks.length);
+ chrome.test.assertEq(
+ 'pkplfbidichfdicaijlchgnapepdginl|app|' +
+ 'magic_handler',
+ tasks[0].taskId);
+ var onLaunched = function(event) {
+ chrome.test.assertTrue(!!event);
+ chrome.test.assertEq('magic_handler', event.id);
+ chrome.test.assertTrue(!!event.items);
+ chrome.test.assertEq(1, event.items.length);
+ chrome.test.assertEq(
+ TESTING_MIME_TYPE, event.items[0].type);
+ chrome.test.assertEq(
+ TESTING_WITH_MIME_FILE.name,
+ event.items[0].entry.name);
+ chrome.app.runtime.onLaunched.removeListener(
+ onLaunched);
+ };
+ chrome.app.runtime.onLaunched.addListener(onLaunched);
+ chrome.fileManagerPrivate.executeTask(
+ tasks[0].taskId, [entry.toURL()]);
+ }));
+ })).catch(chrome.test.fail);
+ }), function(error) {
+ chrome.test.fail(error.name);
+ });
},
// The file without a mime set must not appear on the task list for this
@@ -118,11 +127,15 @@ function runTests() {
TESTING_WITHOUT_MIME_FILE.name,
{},
chrome.test.callbackPass(function(entry) {
- chrome.fileManagerPrivate.getFileTasks(
- [entry.toURL()],
- chrome.test.callbackPass(function(tasks) {
- chrome.test.assertEq(0, tasks.length);
- }));
+ test_util.toExternalEntry(entry).then(
+ chrome.test.callbackPass(function(externalEntry) {
+ chrome.test.assertTrue(!!externalEntry);
+ chrome.fileManagerPrivate.getFileTasks(
+ [externalEntry.toURL()],
+ chrome.test.callbackPass(function(tasks) {
+ chrome.test.assertEq(0, tasks.length);
+ }));
+ })).catch(chrome.test.fail);
}), function(error) {
chrome.test.fail(error.name);
});

Powered by Google App Engine
This is Rietveld 408576698