Chromium Code Reviews| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 * @param {string} sourceFileName Source file name that provides file contents. | 155 * @param {string} sourceFileName Source file name that provides file contents. |
| 156 * @param {string} targetName Name of entry on the test file system. | 156 * @param {string} targetName Name of entry on the test file system. |
| 157 * @param {string} mimeType Mime type. | 157 * @param {string} mimeType Mime type. |
| 158 * @param {SharedOption} sharedOption Shared option. | 158 * @param {SharedOption} sharedOption Shared option. |
| 159 * @param {string} lastModifiedTime Last modified time as a text to be shown in | 159 * @param {string} lastModifiedTime Last modified time as a text to be shown in |
| 160 * the last modified column. | 160 * the last modified column. |
| 161 * @param {string} nameText File name to be shown in the name column. | 161 * @param {string} nameText File name to be shown in the name column. |
| 162 * @param {string} sizeText Size text to be shown in the size column. | 162 * @param {string} sizeText Size text to be shown in the size column. |
| 163 * @param {string} typeText Type name to be shown in the type column. | 163 * @param {string} typeText Type name to be shown in the type column. |
| 164 * @constructor | 164 * @constructor |
| 165 * | |
| 166 * TODO: lastModifiedTime in string is not robust wrt date-time format change. | |
| 167 * See http://crbug.com/383930 | |
|
hirono
2014/06/13 02:32:21
I'm not sure we should do this.
I'd like to track
| |
| 165 */ | 168 */ |
| 166 function TestEntryInfo(type, | 169 function TestEntryInfo(type, |
| 167 sourceFileName, | 170 sourceFileName, |
| 168 targetPath, | 171 targetPath, |
| 169 mimeType, | 172 mimeType, |
| 170 sharedOption, | 173 sharedOption, |
| 171 lastModifiedTime, | 174 lastModifiedTime, |
| 172 nameText, | 175 nameText, |
| 173 sizeText, | 176 sizeText, |
| 174 typeText) { | 177 typeText) { |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 196 }; | 199 }; |
| 197 | 200 |
| 198 /** | 201 /** |
| 199 * Filesystem entries used by the test cases. | 202 * Filesystem entries used by the test cases. |
| 200 * @type {Object.<string, TestEntryInfo>} | 203 * @type {Object.<string, TestEntryInfo>} |
| 201 * @const | 204 * @const |
| 202 */ | 205 */ |
| 203 var ENTRIES = { | 206 var ENTRIES = { |
| 204 hello: new TestEntryInfo( | 207 hello: new TestEntryInfo( |
| 205 EntryType.FILE, 'text.txt', 'hello.txt', | 208 EntryType.FILE, 'text.txt', 'hello.txt', |
| 206 'text/plain', SharedOption.NONE, 'Sep 4, 1998 12:34 PM', | 209 'text/plain', SharedOption.NONE, 'Sep 4, 1998, 12:34 PM', |
| 207 'hello.txt', '51 bytes', 'Plain text'), | 210 'hello.txt', '51 bytes', 'Plain text'), |
| 208 | 211 |
| 209 world: new TestEntryInfo( | 212 world: new TestEntryInfo( |
| 210 EntryType.FILE, 'video.ogv', 'world.ogv', | 213 EntryType.FILE, 'video.ogv', 'world.ogv', |
| 211 'text/plain', SharedOption.NONE, 'Jul 4, 2012 10:35 AM', | 214 'text/plain', SharedOption.NONE, 'Jul 4, 2012, 10:35 AM', |
| 212 'world.ogv', '59 KB', 'OGG video'), | 215 'world.ogv', '59 KB', 'OGG video'), |
| 213 | 216 |
| 214 unsupported: new TestEntryInfo( | 217 unsupported: new TestEntryInfo( |
| 215 EntryType.FILE, 'random.bin', 'unsupported.foo', | 218 EntryType.FILE, 'random.bin', 'unsupported.foo', |
| 216 'application/x-foo', SharedOption.NONE, 'Jul 4, 2012 10:36 AM', | 219 'application/x-foo', SharedOption.NONE, 'Jul 4, 2012, 10:36 AM', |
| 217 'unsupported.foo', '8 KB', 'FOO file'), | 220 'unsupported.foo', '8 KB', 'FOO file'), |
| 218 | 221 |
| 219 desktop: new TestEntryInfo( | 222 desktop: new TestEntryInfo( |
| 220 EntryType.FILE, 'image.png', 'My Desktop Background.png', | 223 EntryType.FILE, 'image.png', 'My Desktop Background.png', |
| 221 'text/plain', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 224 'text/plain', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
| 222 'My Desktop Background.png', '272 bytes', 'PNG image'), | 225 'My Desktop Background.png', '272 bytes', 'PNG image'), |
| 223 | 226 |
| 224 image2: new TestEntryInfo( | 227 image2: new TestEntryInfo( |
| 225 EntryType.FILE, 'image2.png', 'image2.png', | 228 EntryType.FILE, 'image2.png', 'image2.png', |
| 226 'image/png', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 229 'image/png', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
| 227 'image2.png', '272 bytes', 'PNG image'), | 230 'image2.png', '272 bytes', 'PNG image'), |
| 228 | 231 |
| 229 image3: new TestEntryInfo( | 232 image3: new TestEntryInfo( |
| 230 EntryType.FILE, 'image3.jpg', 'image3.jpg', | 233 EntryType.FILE, 'image3.jpg', 'image3.jpg', |
| 231 'image/jpg', SharedOption.NONE, 'Jan 18, 2038 1:02 AM', | 234 'image/jpg', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', |
| 232 'image3.jpg', '272 bytes', 'JPEG image'), | 235 'image3.jpg', '272 bytes', 'JPEG image'), |
| 233 | 236 |
| 234 beautiful: new TestEntryInfo( | 237 beautiful: new TestEntryInfo( |
| 235 EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', | 238 EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', |
| 236 'text/plain', SharedOption.NONE, 'Nov 12, 2086 12:00 PM', | 239 'text/plain', SharedOption.NONE, 'Nov 12, 2086, 12:00 PM', |
| 237 'Beautiful Song.ogg', '14 KB', 'OGG audio'), | 240 'Beautiful Song.ogg', '14 KB', 'OGG audio'), |
| 238 | 241 |
| 239 photos: new TestEntryInfo( | 242 photos: new TestEntryInfo( |
| 240 EntryType.DIRECTORY, null, 'photos', | 243 EntryType.DIRECTORY, null, 'photos', |
| 241 null, SharedOption.NONE, 'Jan 1, 1980 11:59 PM', | 244 null, SharedOption.NONE, 'Jan 1, 1980, 11:59 PM', |
| 242 'photos', '--', 'Folder'), | 245 'photos', '--', 'Folder'), |
| 243 | 246 |
| 244 testDocument: new TestEntryInfo( | 247 testDocument: new TestEntryInfo( |
| 245 EntryType.FILE, null, 'Test Document', | 248 EntryType.FILE, null, 'Test Document', |
| 246 'application/vnd.google-apps.document', | 249 'application/vnd.google-apps.document', |
| 247 SharedOption.NONE, 'Apr 10, 2013 4:20 PM', | 250 SharedOption.NONE, 'Apr 10, 2013, 4:20 PM', |
| 248 'Test Document.gdoc', '--', 'Google document'), | 251 'Test Document.gdoc', '--', 'Google document'), |
| 249 | 252 |
| 250 testSharedDocument: new TestEntryInfo( | 253 testSharedDocument: new TestEntryInfo( |
| 251 EntryType.FILE, null, 'Test Shared Document', | 254 EntryType.FILE, null, 'Test Shared Document', |
| 252 'application/vnd.google-apps.document', | 255 'application/vnd.google-apps.document', |
| 253 SharedOption.SHARED, 'Mar 20, 2013 10:40 PM', | 256 SharedOption.SHARED, 'Mar 20, 2013, 10:40 PM', |
| 254 'Test Shared Document.gdoc', '--', 'Google document'), | 257 'Test Shared Document.gdoc', '--', 'Google document'), |
| 255 | 258 |
| 256 newlyAdded: new TestEntryInfo( | 259 newlyAdded: new TestEntryInfo( |
| 257 EntryType.FILE, 'music.ogg', 'newly added file.ogg', | 260 EntryType.FILE, 'music.ogg', 'newly added file.ogg', |
| 258 'audio/ogg', SharedOption.NONE, 'Sep 4, 1998 12:00 AM', | 261 'audio/ogg', SharedOption.NONE, 'Sep 4, 1998, 12:00 AM', |
| 259 'newly added file.ogg', '14 KB', 'OGG audio'), | 262 'newly added file.ogg', '14 KB', 'OGG audio'), |
| 260 | 263 |
| 261 directoryA: new TestEntryInfo( | 264 directoryA: new TestEntryInfo( |
| 262 EntryType.DIRECTORY, null, 'A', | 265 EntryType.DIRECTORY, null, 'A', |
| 263 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 266 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 264 'A', '--', 'Folder'), | 267 'A', '--', 'Folder'), |
| 265 | 268 |
| 266 directoryB: new TestEntryInfo( | 269 directoryB: new TestEntryInfo( |
| 267 EntryType.DIRECTORY, null, 'A/B', | 270 EntryType.DIRECTORY, null, 'A/B', |
| 268 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 271 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 269 'B', '--', 'Folder'), | 272 'B', '--', 'Folder'), |
| 270 | 273 |
| 271 directoryC: new TestEntryInfo( | 274 directoryC: new TestEntryInfo( |
| 272 EntryType.DIRECTORY, null, 'A/B/C', | 275 EntryType.DIRECTORY, null, 'A/B/C', |
| 273 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 276 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 274 'C', '--', 'Folder'), | 277 'C', '--', 'Folder'), |
| 275 | 278 |
| 276 directoryD: new TestEntryInfo( | 279 directoryD: new TestEntryInfo( |
| 277 EntryType.DIRECTORY, null, 'D', | 280 EntryType.DIRECTORY, null, 'D', |
| 278 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 281 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 279 'D', '--', 'Folder'), | 282 'D', '--', 'Folder'), |
| 280 | 283 |
| 281 directoryE: new TestEntryInfo( | 284 directoryE: new TestEntryInfo( |
| 282 EntryType.DIRECTORY, null, 'D/E', | 285 EntryType.DIRECTORY, null, 'D/E', |
| 283 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 286 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 284 'E', '--', 'Folder'), | 287 'E', '--', 'Folder'), |
| 285 | 288 |
| 286 directoryF: new TestEntryInfo( | 289 directoryF: new TestEntryInfo( |
| 287 EntryType.DIRECTORY, null, 'D/E/F', | 290 EntryType.DIRECTORY, null, 'D/E/F', |
| 288 null, SharedOption.NONE, 'Jan 1, 2000 1:00 AM', | 291 null, SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', |
| 289 'F', '--', 'Folder'), | 292 'F', '--', 'Folder'), |
| 290 | 293 |
| 291 zipArchive: new TestEntryInfo( | 294 zipArchive: new TestEntryInfo( |
| 292 EntryType.FILE, 'archive.zip', 'archive.zip', | 295 EntryType.FILE, 'archive.zip', 'archive.zip', |
| 293 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014 1:00 AM', | 296 'application/x-zip', SharedOption.NONE, 'Jan 1, 2014, 1:00 AM', |
| 294 'archive.zip', '533 bytes', 'Zip archive') | 297 'archive.zip', '533 bytes', 'Zip archive') |
| 295 }; | 298 }; |
| OLD | NEW |