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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 'disableColorOption': false, | 715 'disableColorOption': false, |
716 'setColorAsDefault': true, | 716 'setColorAsDefault': true, |
717 'disableCopiesOption': true, | 717 'disableCopiesOption': true, |
718 'disableLandscapeOption': true, | 718 'disableLandscapeOption': true, |
719 'printerDefaultDuplexValue': 0 | 719 'printerDefaultDuplexValue': 0 |
720 }; | 720 }; |
721 this.nativeLayer_.dispatchEvent(capsSetEvent); | 721 this.nativeLayer_.dispatchEvent(capsSetEvent); |
722 | 722 |
723 var previewGenerator = mock(print_preview.PreviewGenerator); | 723 var previewGenerator = mock(print_preview.PreviewGenerator); |
724 printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy(); | 724 printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy(); |
725 previewGenerator.expects(exactly(6)).requestPreview(); | 725 previewGenerator.expects(atLeastOnce()).requestPreview(); |
726 | 726 |
727 var barDestination; | 727 var barDestination; |
728 var destinations = printPreview.destinationStore_.destinations; | 728 var destinations = printPreview.destinationStore_.destinations; |
729 for (var destination, i = 0; destination = destinations[i]; i++) { | 729 for (var destination, i = 0; destination = destinations[i]; i++) { |
730 if (destination.id == 'BarDevice') { | 730 if (destination.id == 'BarDevice') { |
731 barDestination = destination; | 731 barDestination = destination; |
732 break; | 732 break; |
733 } | 733 } |
734 } | 734 } |
735 | 735 |
(...skipping 25 matching lines...) Expand all Loading... |
761 expectEquals(true, previewFailedMessageEl.hidden); | 761 expectEquals(true, previewFailedMessageEl.hidden); |
762 | 762 |
763 var printFailedMessageEl = | 763 var printFailedMessageEl = |
764 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; | 764 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; |
765 expectEquals(true, printFailedMessageEl.hidden); | 765 expectEquals(true, printFailedMessageEl.hidden); |
766 | 766 |
767 var customMessageEl = | 767 var customMessageEl = |
768 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; | 768 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; |
769 expectEquals(false, customMessageEl.hidden); | 769 expectEquals(false, customMessageEl.hidden); |
770 }); | 770 }); |
OLD | NEW |