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

Side by Side Diff: chrome/test/data/extensions/api_test/file_manager_browsertest/test_util.js

Issue 667843005: Files.app: Refactoring for the onMessage function of FIleManagerBrowserTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/file_manager_browsertest/file_manager/file_display.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Sends a test message. 8 * Sends a test message.
9 * @param {Object} message Message to be sent. It is converted into JSON string 9 * @param {Object} message Message to be sent. It is converted into JSON string
10 * before sending. 10 * before sending.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 function addEntries(volumeNames, entries, opt_callback) { 102 function addEntries(volumeNames, entries, opt_callback) {
103 if (volumeNames.length == 0) { 103 if (volumeNames.length == 0) {
104 callback(true); 104 callback(true);
105 return; 105 return;
106 } 106 }
107 var volumeResultPromises = volumeNames.map(function(volume) { 107 var volumeResultPromises = volumeNames.map(function(volume) {
108 return sendTestMessage({ 108 return sendTestMessage({
109 name: 'addEntries', 109 name: 'addEntries',
110 volume: volume, 110 volume: volume,
111 entries: entries 111 entries: entries
112 }).then(function(result) {
113 if (result !== "onEntryAdded")
114 return Promise.reject('Failed to add entries to ' + volume + '.');
115 }); 112 });
116 }); 113 });
117 var resultPromise = Promise.all(volumeResultPromises); 114 var resultPromise = Promise.all(volumeResultPromises);
118 if (opt_callback) { 115 if (opt_callback) {
119 resultPromise.then(opt_callback.bind(null, true), 116 resultPromise.then(opt_callback.bind(null, true),
120 opt_callback.bind(null, false)); 117 opt_callback.bind(null, false));
121 } 118 }
122 return resultPromise; 119 return resultPromise;
123 }; 120 };
124 121
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 directoryF: new TestEntryInfo( 283 directoryF: new TestEntryInfo(
287 EntryType.DIRECTORY, null, 'D/E/F', 284 EntryType.DIRECTORY, null, 'D/E/F',
288 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', 285 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM',
289 'F', '--', 'Folder'), 286 'F', '--', 'Folder'),
290 287
291 zipArchive: new TestEntryInfo( 288 zipArchive: new TestEntryInfo(
292 EntryType.FILE, 'archive.zip', 'archive.zip', 289 EntryType.FILE, 'archive.zip', 'archive.zip',
293 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014, 1:00 AM', 290 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014, 1:00 AM',
294 'archive.zip', '533 bytes', 'Zip archive') 291 'archive.zip', '533 bytes', 'Zip archive')
295 }; 292 };
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/file_manager_browsertest/file_manager/file_display.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698