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

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

Issue 2969383003: Print Preview: Finish removing global Javascript functions. (Closed)
Patch Set: Move listener addition Created 3 years, 5 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
Index: chrome/test/data/webui/print_preview/print_preview_tests.js
diff --git a/chrome/test/data/webui/print_preview/print_preview_tests.js b/chrome/test/data/webui/print_preview/print_preview_tests.js
index b38e99f64b2a655caa09b2328e8af6fd0046935b..39e5c883773110acbc8458f2868e9f902f14e592 100644
--- a/chrome/test/data/webui/print_preview/print_preview_tests.js
+++ b/chrome/test/data/webui/print_preview/print_preview_tests.js
@@ -693,21 +693,12 @@ cr.define('print_preview_test', function() {
return setupSettingsAndDestinationsWithCapabilities().then(function() {
// Indicate that the number of copies print preset is set for source
// PDF.
- var printPresetOptions = {
- disableScaling: true,
- copies: 2
- };
- var printPresetOptionsEvent = new Event(
- print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS);
- printPresetOptionsEvent.optionsFromDocument = printPresetOptions;
- nativeLayer.getEventTarget().
- dispatchEvent(printPresetOptionsEvent);
-
+ var copies = 2;
+ cr.webUIListenerCallback('print-preset-options', true, copies);
checkSectionVisible($('copies-settings'), true);
expectEquals(
- printPresetOptions.copies,
- parseInt($('copies-settings').
- querySelector('.user-value').value));
+ copies,
+ parseInt($('copies-settings').querySelector('.user-value').value));
return whenAnimationDone('other-options-collapsible');
});
@@ -720,15 +711,7 @@ cr.define('print_preview_test', function() {
return setupSettingsAndDestinationsWithCapabilities().then(function() {
// Indicate that the duplex print preset is set to 'long edge' for
// source PDF.
- var printPresetOptions = {
- duplex: 1
- };
- var printPresetOptionsEvent = new Event(
- print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS);
- printPresetOptionsEvent.optionsFromDocument = printPresetOptions;
- nativeLayer.getEventTarget().
- dispatchEvent(printPresetOptionsEvent);
-
+ cr.webUIListenerCallback('print-preset-options', false, 1, 1);
var otherOptions = $('other-options-settings');
checkSectionVisible(otherOptions, true);
var duplexContainer =

Powered by Google App Engine
This is Rietveld 408576698