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

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

Issue 329483002: [fsp] Group arguments for API methods and events in dictionaries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 years, 6 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
« no previous file with comments | « chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js b/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
index 54f63290e06d32f0fd8e9deb9f649907cd56e002..acefcafc3c741a954deaab517e5f03dda89362e0 100644
--- a/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
+++ b/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
@@ -46,15 +46,13 @@ function setUp(callback) {
Promise.race([
new Promise(function(fulfill, reject) {
chrome.fileSystemProvider.mount(
- FIRST_FILE_SYSTEM_ID,
- 'vanilla.zip',
+ {fileSystemId: FIRST_FILE_SYSTEM_ID, displayName: 'vanilla.zip'},
function() { fulfill(); },
function(error) { reject(error); });
}),
new Promise(function(fulfill, reject) {
chrome.fileSystemProvider.mount(
- SECOND_FILE_SYSTEM_ID,
- 'ice-cream.zip',
+ {fileSystemId: SECOND_FILE_SYSTEM_ID, displayName: 'ice-cream.zip'},
function() { fulfill(); },
function(error) { reject(error); });
})
@@ -87,23 +85,29 @@ function runTests() {
chrome.fileBrowserPrivate.onMountCompleted.addListener(
onMountCompleted);
- chrome.fileSystemProvider.unmount(FIRST_FILE_SYSTEM_ID, function() {
- // Wait for the unmount event.
- }, function(error) {
- chrome.test.fail(error.name);
- });
+ chrome.fileSystemProvider.unmount(
+ {fileSystemId: FIRST_FILE_SYSTEM_ID},
+ function() {
+ // Wait for the unmount event.
+ },
+ function(error) {
+ chrome.test.fail(error.name);
+ });
},
// Tests the fileSystemProvider.unmount() with a wrong id. Verifies that
// it fails with a correct error code.
function unmountWrongId() {
var onTestSuccess = chrome.test.callbackPass();
- chrome.fileSystemProvider.unmount('wrong-fs-id', function() {
- chrome.test.fail();
- }, function(error) {
- chrome.test.assertEq('SecurityError', error.name);
- onTestSuccess();
- });
+ chrome.fileSystemProvider.unmount(
+ {fileSystemId: 'wrong-fs-id'},
+ function() {
+ chrome.test.fail();
+ },
+ function(error) {
+ chrome.test.assertEq('SecurityError', error.name);
+ onTestSuccess();
+ });
},
// Tests if fileBrowserPrivate.removeMount() for provided file systems emits
@@ -111,8 +115,8 @@ function runTests() {
function requestUnmountSuccess() {
var onTestSuccess = chrome.test.callbackPass();
- var onUnmountRequested = function(fileSystemId, onSuccess, onError) {
- chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, fileSystemId);
+ var onUnmountRequested = function(options, onSuccess, onError) {
+ chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, options.fileSystemId);
onSuccess();
// Not calling fileSystemProvider.unmount(), so the onMountCompleted
// event will not be raised.
@@ -138,9 +142,9 @@ function runTests() {
var onTestSuccess = chrome.test.callbackPass();
var unmountRequested = false;
- var onUnmountRequested = function(fileSystemId, onSuccess, onError) {
+ var onUnmountRequested = function(options, onSuccess, onError) {
chrome.test.assertEq(false, unmountRequested);
- chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, fileSystemId);
+ chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, options.fileSystemId);
onError('IN_USE'); // enum ProviderError.
unmountRequested = true;
chrome.fileSystemProvider.onUnmountRequested.removeListener(
« no previous file with comments | « chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698