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

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

Issue 10829229: Fix duplex defaults. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 var duplexCheckbox = otherOptionsDiv.querySelector('.duplex-checkbox'); 641 var duplexCheckbox = otherOptionsDiv.querySelector('.duplex-checkbox');
642 642
643 var capsSetEvent = 643 var capsSetEvent =
644 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); 644 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET);
645 capsSetEvent.settingsInfo = { 645 capsSetEvent.settingsInfo = {
646 'printerId': 'FooDevice', 646 'printerId': 'FooDevice',
647 'disableColorOption': false, 647 'disableColorOption': false,
648 'setColorAsDefault': true, 648 'setColorAsDefault': true,
649 'disableCopiesOption': false, 649 'disableCopiesOption': false,
650 'disableLandscapeOption': true, 650 'disableLandscapeOption': true,
651 'printerDefaultDuplexValue': 0 651 'printerDefaultDuplexValue': 0,
652 'setDuplexAsDefault': false
652 }; 653 };
653 this.nativeLayer_.dispatchEvent(capsSetEvent); 654 this.nativeLayer_.dispatchEvent(capsSetEvent);
654 655
655 checkSectionVisible(otherOptionsDiv, true); 656 checkSectionVisible(otherOptionsDiv, true);
656 expectFalse(duplexDiv.hidden); 657 expectFalse(duplexDiv.hidden);
657 expectFalse(duplexCheckbox.checked); 658 expectFalse(duplexCheckbox.checked);
658 659
659 // If the printer default duplex value is UNKNOWN_DUPLEX_MODE, hide the 660 // If the printer default duplex value is UNKNOWN_DUPLEX_MODE, hide the
660 // two sided option. 661 // two sided option.
661 var capsSetEvent = 662 var capsSetEvent =
(...skipping 12 matching lines...) Expand all
674 expectTrue(duplexDiv.hidden); 675 expectTrue(duplexDiv.hidden);
675 676
676 var capsSetEvent = 677 var capsSetEvent =
677 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET); 678 new cr.Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET);
678 capsSetEvent.settingsInfo = { 679 capsSetEvent.settingsInfo = {
679 'printerId': 'FooDevice', 680 'printerId': 'FooDevice',
680 'disableColorOption': false, 681 'disableColorOption': false,
681 'setColorAsDefault': false, 682 'setColorAsDefault': false,
682 'disableCopiesOption': false, 683 'disableCopiesOption': false,
683 'disableLandscapeOption': false, 684 'disableLandscapeOption': false,
684 'printerDefaultDuplexValue': 1 685 'printerDefaultDuplexValue': 1,
686 'setDuplexAsDefault': true
685 }; 687 };
686 this.nativeLayer_.dispatchEvent(capsSetEvent); 688 this.nativeLayer_.dispatchEvent(capsSetEvent);
687 689
688 checkSectionVisible(otherOptionsDiv, true); 690 checkSectionVisible(otherOptionsDiv, true);
689 expectFalse(duplexDiv.hidden); 691 expectFalse(duplexDiv.hidden);
690 expectTrue(duplexCheckbox.checked); 692 expectTrue(duplexCheckbox.checked);
691 }); 693 });
692 694
693 // Test that changing the selected printer updates the preview. 695 // Test that changing the selected printer updates the preview.
694 TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() { 696 TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 expectEquals(true, previewFailedMessageEl.hidden); 758 expectEquals(true, previewFailedMessageEl.hidden);
757 759
758 var printFailedMessageEl = 760 var printFailedMessageEl =
759 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0]; 761 previewAreaEl.getElementsByClassName('preview-area-print-failed')[0];
760 expectEquals(true, printFailedMessageEl.hidden); 762 expectEquals(true, printFailedMessageEl.hidden);
761 763
762 var customMessageEl = 764 var customMessageEl =
763 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0]; 765 previewAreaEl.getElementsByClassName('preview-area-custom-message')[0];
764 expectEquals(false, customMessageEl.hidden); 766 expectEquals(false, customMessageEl.hidden);
765 }); 767 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698