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

Unified Diff: chrome/test/data/webui/print_preview.js

Issue 308943002: Reset margin input controls error state when error is cleared. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/print_preview/previewarea/margin_control_container.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/print_preview.js
diff --git a/chrome/test/data/webui/print_preview.js b/chrome/test/data/webui/print_preview.js
index 3a51956c780355b014d265537e7fdcaf0dc2a9b7..22f6389dd2bcb7b93ea0a9febab0b56171410d11 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -410,6 +410,42 @@ TEST_F('PrintPreviewWebUITest', 'PrintScalingDisabledForPlugin', function() {
checked);
});
+// Make sure that custom margins controls are properly set up.
+TEST_F('PrintPreviewWebUITest', 'CustomMarginsControlsCheck', function() {
+ var initialSettingsSetEvent =
+ new Event(print_preview.NativeLayer.EventType.INITIAL_SETTINGS_SET);
+ initialSettingsSetEvent.initialSettings = this.initialSettings_;
+ this.nativeLayer_.dispatchEvent(initialSettingsSetEvent);
+
+ var localDestsSetEvent =
+ new Event(print_preview.NativeLayer.EventType.LOCAL_DESTINATIONS_SET);
+ localDestsSetEvent.destinationInfos = this.localDestinationInfos_;
+ this.nativeLayer_.dispatchEvent(localDestsSetEvent);
+
+ var capsSetEvent =
+ new Event(print_preview.NativeLayer.EventType.CAPABILITIES_SET);
+ capsSetEvent.settingsInfo = {
+ 'printerId': 'FooDevice',
+ 'disableColorOption': false,
+ 'setColorAsDefault': true,
+ 'disableCopiesOption': true,
+ 'disableLandscapeOption': true,
+ 'printerDefaultDuplexValue': 0
+ };
+ this.nativeLayer_.dispatchEvent(capsSetEvent);
+
+ printPreview.printTicketStore_.marginsType.updateValue(
+ print_preview.ticket_items.MarginsType.Value.CUSTOM);
+
+ ['left', 'top', 'right', 'bottom'].forEach(function(margin) {
+ var control = $('preview-area').querySelector('.margin-control-' + margin);
+ assertNotEquals(null, control);
+ var input = control.querySelector('.margin-control-textbox');
+ assertTrue(input.hasAttribute('aria-label'));
+ assertNotEquals('undefined', input.getAttribute('aria-label'));
+ });
+});
+
// Page layout has zero margins. Hide header and footer option.
TEST_F('PrintPreviewWebUITest',
'PageLayoutHasNoMarginsHideHeaderFooter',
« no previous file with comments | « chrome/browser/resources/print_preview/previewarea/margin_control_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698