OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * Test fixture for print preview WebUI testing. | 6 * Test fixture for print preview WebUI testing. |
7 * @constructor | 7 * @constructor |
8 * @extends {testing.Test} | 8 * @extends {testing.Test} |
9 */ | 9 */ |
10 function PrintPreviewWebUITest() { | 10 function PrintPreviewWebUITest() { |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 'disableLandscapeOption': true, | 714 'disableLandscapeOption': true, |
715 'printerDefaultDuplexValue': 0 | 715 'printerDefaultDuplexValue': 0 |
716 }; | 716 }; |
717 this.nativeLayer_.dispatchEvent(capsSetEvent); | 717 this.nativeLayer_.dispatchEvent(capsSetEvent); |
718 | 718 |
719 var previewGenerator = mock(print_preview.PreviewGenerator); | 719 var previewGenerator = mock(print_preview.PreviewGenerator); |
720 printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy(); | 720 printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy(); |
721 previewGenerator.expects(exactly(6)).requestPreview(); | 721 previewGenerator.expects(exactly(6)).requestPreview(); |
722 | 722 |
723 var barDestination; | 723 var barDestination; |
724 var destinations = printPreview.destinationStore_.destinations; | 724 var destinations = printPreview.destinationStore_.destinations(); |
725 for (var destination, i = 0; destination = destinations[i]; i++) { | 725 for (var destination, i = 0; destination = destinations[i]; i++) { |
726 if (destination.id == 'BarDevice') { | 726 if (destination.id == 'BarDevice') { |
727 barDestination = destination; | 727 barDestination = destination; |
728 break; | 728 break; |
729 } | 729 } |
730 } | 730 } |
731 | 731 |
732 printPreview.destinationStore_.selectDestination(barDestination); | 732 printPreview.destinationStore_.selectDestination(barDestination); |
733 | 733 |
734 var capsSetEvent = | 734 var capsSetEvent = |
(...skipping 22 matching lines...) Expand all Loading... |
757 expectEquals(true, previewFailedMessageEl.hidden); | 757 expectEquals(true, previewFailedMessageEl.hidden); |
758 | 758 |
759 var printFailedMessageEl = | 759 var printFailedMessageEl = |
760 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; | 760 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; |
761 expectEquals(true, printFailedMessageEl.hidden); | 761 expectEquals(true, printFailedMessageEl.hidden); |
762 | 762 |
763 var customMessageEl = | 763 var customMessageEl = |
764 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; | 764 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; |
765 expectEquals(false, customMessageEl.hidden); | 765 expectEquals(false, customMessageEl.hidden); |
766 }); | 766 }); |
OLD | NEW |