OLD | NEW |
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 }; | 196 }; |
197 | 197 |
198 /** | 198 /** |
199 * Filesystem entries used by the test cases. | 199 * Filesystem entries used by the test cases. |
200 * @type {Object.<string, TestEntryInfo>} | 200 * @type {Object.<string, TestEntryInfo>} |
201 * @const | 201 * @const |
202 */ | 202 */ |
203 var ENTRIES = { | 203 var ENTRIES = { |
204 hello: new TestEntryInfo( | 204 hello: new TestEntryInfo( |
205 EntryType.FILE, 'text.txt', 'hello.txt', | 205 EntryType.FILE, 'text.txt', 'hello.txt', |
206 'text/plain', SharedOption.NONE, 'Sep 4, 1998 12:34 PM', | 206 'text/plain', SharedOption.NONE, 'Sep 4, 1998, 12:34 PM', |
207 'hello.txt', '51 bytes', 'Plain text'), | 207 'hello.txt', '51 bytes', 'Plain text'), |
208 | 208 |
209 world: new TestEntryInfo( | 209 world: new TestEntryInfo( |
210 EntryType.FILE, 'video.ogv', 'world.ogv', | 210 EntryType.FILE, 'video.ogv', 'world.ogv', |
211 'text/plain', SharedOption.NONE, 'Jul 4, 2012 10:35 AM', | 211 'text/plain', SharedOption.NONE, 'Jul 4, 2012, 10:35 AM', |
212 'world.ogv', '59 KB', 'OGG video'), | 212 'world.ogv', '59 KB', 'OGG video'), |
213 | 213 |
214 unsupported: new TestEntryInfo( | 214 unsupported: new TestEntryInfo( |
215 EntryType.FILE, 'random.bin', 'unsupported.foo', | 215 EntryType.FILE, 'random.bin', 'unsupported.foo', |
216 'application/x-foo', SharedOption.NONE, 'Jul 4, 2012 10:36 AM', | 216 'application/x-foo', SharedOption.NONE, 'Jul 4, 2012, 10:36 AM', |
217 'unsupported.foo', '8 KB', 'FOO file'), | 217 'unsupported.foo', '8 KB', 'FOO file'), |
218 | 218 |
219 desktop: new TestEntryInfo( | 219 desktop: new TestEntryInfo( |
220 EntryType.FILE, 'image.png', 'My Desktop Background.png', | 220 EntryType.FILE, 'image.png', 'My Desktop Background.png', |
221 'text/plain', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 221 'text/plain', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
222 'My Desktop Background.png', '272 bytes', 'PNG image'), | 222 'My Desktop Background.png', '272 bytes', 'PNG image'), |
223 | 223 |
224 image2: new TestEntryInfo( | 224 image2: new TestEntryInfo( |
225 EntryType.FILE, 'image2.png', 'image2.png', | 225 EntryType.FILE, 'image2.png', 'image2.png', |
226 'image/png', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 226 'image/png', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
227 'image2.png', '272 bytes', 'PNG image'), | 227 'image2.png', '272 bytes', 'PNG image'), |
228 | 228 |
229 image3: new TestEntryInfo( | 229 image3: new TestEntryInfo( |
230 EntryType.FILE, 'image3.jpg', 'image3.jpg', | 230 EntryType.FILE, 'image3.jpg', 'image3.jpg', |
231 'image/jpg', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 231 'image/jpg', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
232 'image3.jpg', '272 bytes', 'JPEG image'), | 232 'image3.jpg', '272 bytes', 'JPEG image'), |
233 | 233 |
234 beautiful: new TestEntryInfo( | 234 beautiful: new TestEntryInfo( |
235 EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', | 235 EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', |
236 'text/plain', SharedOption.NONE, 'Nov 12, 2086 12:00 PM', | 236 'text/plain', SharedOption.NONE, 'Nov 12, 2086, 12:00 PM', |
237 'Beautiful Song.ogg', '14 KB', 'OGG audio'), | 237 'Beautiful Song.ogg', '14 KB', 'OGG audio'), |
238 | 238 |
239 photos: new TestEntryInfo( | 239 photos: new TestEntryInfo( |
240 EntryType.DIRECTORY, null, 'photos', | 240 EntryType.DIRECTORY, null, 'photos', |
241 null, SharedOption.NONE, 'Jan 1, 1980 11:59 PM', | 241 null, SharedOption.NONE, 'Jan 1, 1980, 11:59 PM', |
242 'photos', '--', 'Folder'), | 242 'photos', '--', 'Folder'), |
243 | 243 |
244 testDocument: new TestEntryInfo( | 244 testDocument: new TestEntryInfo( |
245 EntryType.FILE, null, 'Test Document', | 245 EntryType.FILE, null, 'Test Document', |
246 'application/vnd.google-apps.document', | 246 'application/vnd.google-apps.document', |
247 SharedOption.NONE, 'Apr 10, 2013 4:20 PM', | 247 SharedOption.NONE, 'Apr 10, 2013, 4:20 PM', |
248 'Test Document.gdoc', '--', 'Google document'), | 248 'Test Document.gdoc', '--', 'Google document'), |
249 | 249 |
250 testSharedDocument: new TestEntryInfo( | 250 testSharedDocument: new TestEntryInfo( |
251 EntryType.FILE, null, 'Test Shared Document', | 251 EntryType.FILE, null, 'Test Shared Document', |
252 'application/vnd.google-apps.document', | 252 'application/vnd.google-apps.document', |
253 SharedOption.SHARED, 'Mar 20, 2013 10:40 PM', | 253 SharedOption.SHARED, 'Mar 20, 2013, 10:40 PM', |
254 'Test Shared Document.gdoc', '--', 'Google document'), | 254 'Test Shared Document.gdoc', '--', 'Google document'), |
255 | 255 |
256 newlyAdded: new TestEntryInfo( | 256 newlyAdded: new TestEntryInfo( |
257 EntryType.FILE, 'music.ogg', 'newly added file.ogg', | 257 EntryType.FILE, 'music.ogg', 'newly added file.ogg', |
258 'audio/ogg', SharedOption.NONE, 'Sep 4, 1998 12:00 AM', | 258 'audio/ogg', SharedOption.NONE, 'Sep 4, 1998, 12:00 AM', |
259 'newly added file.ogg', '14 KB', 'OGG audio'), | 259 'newly added file.ogg', '14 KB', 'OGG audio'), |
260 | 260 |
261 directoryA: new TestEntryInfo( | 261 directoryA: new TestEntryInfo( |
262 EntryType.DIRECTORY, null, 'A', | 262 EntryType.DIRECTORY, null, 'A', |
263 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 263 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
264 'A', '--', 'Folder'), | 264 'A', '--', 'Folder'), |
265 | 265 |
266 directoryB: new TestEntryInfo( | 266 directoryB: new TestEntryInfo( |
267 EntryType.DIRECTORY, null, 'A/B', | 267 EntryType.DIRECTORY, null, 'A/B', |
268 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 268 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
269 'B', '--', 'Folder'), | 269 'B', '--', 'Folder'), |
270 | 270 |
271 directoryC: new TestEntryInfo( | 271 directoryC: new TestEntryInfo( |
272 EntryType.DIRECTORY, null, 'A/B/C', | 272 EntryType.DIRECTORY, null, 'A/B/C', |
273 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 273 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
274 'C', '--', 'Folder'), | 274 'C', '--', 'Folder'), |
275 | 275 |
276 directoryD: new TestEntryInfo( | 276 directoryD: new TestEntryInfo( |
277 EntryType.DIRECTORY, null, 'D', | 277 EntryType.DIRECTORY, null, 'D', |
278 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 278 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
279 'D', '--', 'Folder'), | 279 'D', '--', 'Folder'), |
280 | 280 |
281 directoryE: new TestEntryInfo( | 281 directoryE: new TestEntryInfo( |
282 EntryType.DIRECTORY, null, 'D/E', | 282 EntryType.DIRECTORY, null, 'D/E', |
283 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 283 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
284 'E', '--', 'Folder'), | 284 'E', '--', 'Folder'), |
285 | 285 |
286 directoryF: new TestEntryInfo( | 286 directoryF: new TestEntryInfo( |
287 EntryType.DIRECTORY, null, 'D/E/F', | 287 EntryType.DIRECTORY, null, 'D/E/F', |
288 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 288 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
289 'F', '--', 'Folder'), | 289 'F', '--', 'Folder'), |
290 | 290 |
291 zipArchive: new TestEntryInfo( | 291 zipArchive: new TestEntryInfo( |
292 EntryType.FILE, 'archive.zip', 'archive.zip', | 292 EntryType.FILE, 'archive.zip', 'archive.zip', |
293 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014 1:00 AM', | 293 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014, 1:00 AM', |
294 'archive.zip', '533 bytes', 'Zip archive') | 294 'archive.zip', '533 bytes', 'Zip archive') |
295 }; | 295 }; |
OLD | NEW |