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 /** @type {!MockVolumeManager} */ | 5 /** @type {!MockVolumeManager} */ |
6 var volumeManager; | 6 var volumeManager; |
7 | 7 |
8 /** @type {!TestMediaScanner} */ | 8 /** @type {!TestMediaScanner} */ |
9 var mediaScanner; | 9 var mediaScanner; |
10 | 10 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 * Test implementation of importer.CommandWidget. | 476 * Test implementation of importer.CommandWidget. |
477 * | 477 * |
478 * @constructor | 478 * @constructor |
479 * @implements {importer.CommandWidget} | 479 * @implements {importer.CommandWidget} |
480 * @struct | 480 * @struct |
481 */ | 481 */ |
482 importer.TestCommandWidget = function() { | 482 importer.TestCommandWidget = function() { |
483 /** @public {function()} */ | 483 /** @public {function()} */ |
484 this.executeListener; | 484 this.executeListener; |
485 | 485 |
| 486 /** @public {function()} */ |
| 487 this.destinationListener; |
| 488 |
486 /** @private {!importer.Resolver.<!importer.CommandUpdate>} */ | 489 /** @private {!importer.Resolver.<!importer.CommandUpdate>} */ |
487 this.updateResolver_ = new importer.Resolver(); | 490 this.updateResolver_ = new importer.Resolver(); |
488 | 491 |
489 /** @public {!importer.Resolver.<!importer.CommandUpdate>} */ | 492 /** @public {!importer.Resolver.<!importer.CommandUpdate>} */ |
490 this.updatePromise = this.updateResolver_.promise; | 493 this.updatePromise = this.updateResolver_.promise; |
491 }; | 494 }; |
492 | 495 |
493 /** Resets the widget */ | 496 /** Resets the widget */ |
494 importer.TestCommandWidget.prototype.resetPromise = function() { | 497 importer.TestCommandWidget.prototype.resetPromise = function() { |
495 this.updateResolver_ = new importer.Resolver(); | 498 this.updateResolver_ = new importer.Resolver(); |
496 this.updatePromise = this.updateResolver_.promise; | 499 this.updatePromise = this.updateResolver_.promise; |
497 }; | 500 }; |
498 | 501 |
499 /** @override */ | 502 /** @override */ |
500 importer.TestCommandWidget.prototype.addImportClickedListener = | 503 importer.TestCommandWidget.prototype.addImportClickedListener = |
501 function(listener) { | 504 function(listener) { |
502 this.executeListener = listener; | 505 this.executeListener = listener; |
503 }; | 506 }; |
504 | 507 |
505 /** @override */ | 508 /** @override */ |
| 509 importer.TestCommandWidget.prototype.addDestinationClickedListener = |
| 510 function(listener) { |
| 511 this.destinationListener = listener; |
| 512 }; |
| 513 |
| 514 /** @override */ |
506 importer.TestCommandWidget.prototype.update = function(update) { | 515 importer.TestCommandWidget.prototype.update = function(update) { |
507 assertFalse(this.updateResolver_.settled, 'Should not have been settled.'); | 516 assertFalse(this.updateResolver_.settled, 'Should not have been settled.'); |
508 this.updateResolver_.resolve(update); | 517 this.updateResolver_.resolve(update); |
509 }; | 518 }; |
510 | 519 |
511 /** @override */ | 520 /** @override */ |
512 importer.TestCommandWidget.prototype.updateDetails = function(scan) { | 521 importer.TestCommandWidget.prototype.updateDetails = function(scan) { |
513 // TODO(smckay) | 522 // TODO(smckay) |
514 }; | 523 }; |
515 | 524 |
516 /** @override */ | 525 /** @override */ |
517 importer.TestCommandWidget.prototype.resetDetails = function() { | |
518 // TODO(smckay) | |
519 }; | |
520 | |
521 /** @override */ | |
522 importer.TestCommandWidget.prototype.setDetailsVisible = function(visible) { | 526 importer.TestCommandWidget.prototype.setDetailsVisible = function(visible) { |
523 // TODO(smckay) | 527 // TODO(smckay) |
524 }; | 528 }; |
525 | 529 |
526 /** @override */ | 530 /** @override */ |
527 importer.TestCommandWidget.prototype.isDetailsVisible = function() { | 531 importer.TestCommandWidget.prototype.isDetailsVisible = function() { |
528 // TODO(smckay) | 532 // TODO(smckay) |
529 }; | 533 }; |
530 | 534 |
531 | 535 |
(...skipping 27 matching lines...) Expand all Loading... |
559 * @param {!Array.<string>} fileNames | 563 * @param {!Array.<string>} fileNames |
560 * @return {!VolumeInfo} | 564 * @return {!VolumeInfo} |
561 */ | 565 */ |
562 function setupFileSystem(volumeType, volumeId, fileNames) { | 566 function setupFileSystem(volumeType, volumeId, fileNames) { |
563 var volumeInfo = volumeManager.createVolumeInfo( | 567 var volumeInfo = volumeManager.createVolumeInfo( |
564 volumeType, volumeId, 'A volume known as ' + volumeId); | 568 volumeType, volumeId, 'A volume known as ' + volumeId); |
565 assertTrue(volumeInfo != null); | 569 assertTrue(volumeInfo != null); |
566 volumeInfo.fileSystem.populate(fileNames); | 570 volumeInfo.fileSystem.populate(fileNames); |
567 return volumeInfo; | 571 return volumeInfo; |
568 } | 572 } |
OLD | NEW |