Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Side by Side Diff: chrome/test/data/webui/print_preview.js

Issue 10824322: Merge 150482 - Fix duplex defaults. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/print_preview/data/print_ticket_store.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 var duplexCheckbox = otherOptionsDiv.querySelector('.duplex-checkbox'); 651 var duplexCheckbox = otherOptionsDiv.querySelector('.duplex-checkbox');
652 652
653 var capsSetEvent = 653 var capsSetEvent =
654 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); 654 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET);
655 capsSetEvent.settingsInfo = { 655 capsSetEvent.settingsInfo = {
656 'printerId': 'FooDevice', 656 'printerId': 'FooDevice',
657 'disableColorOption': false, 657 'disableColorOption': false,
658 'setColorAsDefault': true, 658 'setColorAsDefault': true,
659 'disableCopiesOption': false, 659 'disableCopiesOption': false,
660 'disableLandscapeOption': true, 660 'disableLandscapeOption': true,
661 'printerDefaultDuplexValue': 0 661 'printerDefaultDuplexValue': 0,
662 'setDuplexAsDefault': false
662 }; 663 };
663 this.nativeLayer_.dispatchEvent(capsSetEvent); 664 this.nativeLayer_.dispatchEvent(capsSetEvent);
664 665
665 checkSectionVisible(otherOptionsDiv, true); 666 checkSectionVisible(otherOptionsDiv, true);
666 expectFalse(duplexDiv.hidden); 667 expectFalse(duplexDiv.hidden);
667 expectFalse(duplexCheckbox.checked); 668 expectFalse(duplexCheckbox.checked);
668 669
669 // If the printer default duplex value is UNKNOWN_DUPLEX_MODE, hide the 670 // If the printer default duplex value is UNKNOWN_DUPLEX_MODE, hide the
670 // two sided option. 671 // two sided option.
671 var capsSetEvent = 672 var capsSetEvent =
(...skipping 12 matching lines...) Expand all
684 expectTrue(duplexDiv.hidden); 685 expectTrue(duplexDiv.hidden);
685 686
686 var capsSetEvent = 687 var capsSetEvent =
687 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); 688 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET);
688 capsSetEvent.settingsInfo = { 689 capsSetEvent.settingsInfo = {
689 'printerId': 'FooDevice', 690 'printerId': 'FooDevice',
690 'disableColorOption': false, 691 'disableColorOption': false,
691 'setColorAsDefault': false, 692 'setColorAsDefault': false,
692 'disableCopiesOption': false, 693 'disableCopiesOption': false,
693 'disableLandscapeOption': false, 694 'disableLandscapeOption': false,
694 'printerDefaultDuplexValue': 1 695 'printerDefaultDuplexValue': 1,
696 'setDuplexAsDefault': true
695 }; 697 };
696 this.nativeLayer_.dispatchEvent(capsSetEvent); 698 this.nativeLayer_.dispatchEvent(capsSetEvent);
697 699
698 checkSectionVisible(otherOptionsDiv, true); 700 checkSectionVisible(otherOptionsDiv, true);
699 expectFalse(duplexDiv.hidden); 701 expectFalse(duplexDiv.hidden);
700 expectTrue(duplexCheckbox.checked); 702 expectTrue(duplexCheckbox.checked);
701 }); 703 });
702 704
703 // Test that changing the selected printer updates the preview. 705 // Test that changing the selected printer updates the preview.
704 TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() { 706 TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 expectEquals(true, previewFailedMessageEl.hidden); 768 expectEquals(true, previewFailedMessageEl.hidden);
767 769
768 var printFailedMessageEl = 770 var printFailedMessageEl =
769 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; 771 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0];
770 expectEquals(true, printFailedMessageEl.hidden); 772 expectEquals(true, printFailedMessageEl.hidden);
771 773
772 var customMessageEl = 774 var customMessageEl =
773 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; 775 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0];
774 expectEquals(false, customMessageEl.hidden); 776 expectEquals(false, customMessageEl.hidden);
775 }); 777 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/data/print_ticket_store.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698