| // Copyright 2020 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package printer |
| |
| import ( |
| "context" |
| |
| "chromiumos/tast/local/bundles/cros/printer/ippprint" |
| "chromiumos/tast/local/chrome" |
| "chromiumos/tast/testing" |
| ) |
| |
| func init() { |
| testing.AddTest(&testing.Test{ |
| Func: ProxyAdd, |
| Desc: "Verifies the lp command enqueues print jobs", |
| Contacts: []string{ |
| "batrapranav@chromium.org", |
| "cros-printing-dev@chromium.org", |
| }, |
| Attr: []string{ |
| "group:mainline", |
| "group:paper-io", |
| "paper-io_printing", |
| }, |
| SoftwareDeps: []string{"chrome", "cros_internal", "cups", "plugin_vm"}, |
| Pre: chrome.LoggedIn(), |
| Params: []testing.Param{ |
| // Parameters generated by add_test.go. DO NOT EDIT. |
| { |
| Name: "epson_software_collate", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonWF3620.ppd", |
| PrintFile: "2page.pdf", |
| ExpectedFile: "printer_collate_epson_software_collate_golden.bin", |
| Options: []string{"copies=2", "multiple-document-handling=separate-documents-collated-copies"}, |
| }, |
| ExtraData: []string{"2page.pdf", "printer_EpsonWF3620.ppd", "printer_collate_epson_software_collate_golden.bin"}, |
| }, { |
| Name: "epson_software_uncollated", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonWF3620.ppd", |
| PrintFile: "2page.pdf", |
| ExpectedFile: "printer_collate_epson_software_uncollated_golden.bin", |
| Options: []string{"copies=2"}, |
| }, |
| ExtraData: []string{"2page.pdf", "printer_EpsonWF3620.ppd", "printer_collate_epson_software_uncollated_golden.bin"}, |
| }, { |
| Name: "epson_hardware_collate", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonWFC20590.ppd", |
| PrintFile: "2page.pdf", |
| ExpectedFile: "printer_collate_epson_hardware_collate_golden.ps", |
| Options: []string{"copies=2", "multiple-document-handling=separate-documents-collated-copies"}, |
| }, |
| ExtraData: []string{"2page.pdf", "printer_EpsonWFC20590.ppd", "printer_collate_epson_hardware_collate_golden.ps"}, |
| }, { |
| Name: "epson_hardware_uncollated", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonWFC20590.ppd", |
| PrintFile: "2page.pdf", |
| ExpectedFile: "printer_collate_epson_hardware_uncollated_golden.ps", |
| Options: []string{"copies=2"}, |
| }, |
| ExtraData: []string{"2page.pdf", "printer_EpsonWFC20590.ppd", "printer_collate_epson_hardware_uncollated_golden.ps"}, |
| }, { |
| Name: "lexmark_600dpi", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Lexmark.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_resolution_lexmark_600dpi_golden.ps", |
| Options: []string{"printer-resolution=600dpi"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Lexmark.ppd", "printer_resolution_lexmark_600dpi_golden.ps"}, |
| }, { |
| Name: "lexmark_1200dpi", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Lexmark.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_resolution_lexmark_1200dpi_golden.ps", |
| Options: []string{"printer-resolution=1200dpi"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Lexmark.ppd", "printer_resolution_lexmark_1200dpi_golden.ps"}, |
| }, { |
| Name: "lexmark_2400x600dpi", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Lexmark.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_resolution_lexmark_2400x600dpi_golden.ps", |
| Options: []string{"printer-resolution=2400x600dpi"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Lexmark.ppd", "printer_resolution_lexmark_2400x600dpi_golden.ps"}, |
| }, { |
| Name: "media_source_by_pass_tray", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_generic_printer_GenericPostScript.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_media_source_bypass_golden.ps", |
| Options: []string{"media-source=by-pass-tray"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_generic_printer_GenericPostScript.ppd.gz", "printer_add_media_source_bypass_golden.ps"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "media_source_bottom", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_generic_printer_GenericPostScript.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_media_source_bottom_golden.ps", |
| Options: []string{"media-source=bottom"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_generic_printer_GenericPostScript.ppd.gz", "printer_add_media_source_bottom_golden.ps"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "oki_tray4", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_oki.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_oki_tray4_golden.ps", |
| Options: []string{"media-source=tray-4"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_oki.ppd.gz", "printer_add_oki_tray4_golden.ps"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "dymo_lw", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_dymo_printer_lw450.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_dymo_lw_printer_golden.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_dymo_printer_lw450.ppd", "printer_add_dymo_lw_printer_golden.bin"}, |
| }, { |
| Name: "dymo_lm", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_dymo_printer_lm450.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_dymo_lm_printer_golden.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_dymo_printer_lm450.ppd", "printer_add_dymo_lm_printer_golden.bin"}, |
| }, { |
| Name: "epson", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonWF3620.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_epson_printer_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_EpsonWF3620.ppd", "printer_add_epson_printer_golden.ps"}, |
| }, { |
| Name: "epson_color", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonGenericColorModel.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_epson_printer_color_golden.bin", |
| Options: []string{"print-color-mode=color"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_EpsonGenericColorModel.ppd", "printer_add_epson_printer_color_golden.bin"}, |
| }, { |
| Name: "epson_monochrome", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_EpsonGenericColorModel.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_epson_printer_monochrome_golden.bin", |
| Options: []string{"print-color-mode=monochrome"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_EpsonGenericColorModel.ppd", "printer_add_epson_printer_monochrome_golden.bin"}, |
| }, { |
| Name: "generic", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_generic_printer_GenericPostScript.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_generic_printer_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_generic_printer_GenericPostScript.ppd.gz", "printer_add_generic_printer_golden.ps"}, |
| }, { |
| Name: "hp_pclm", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_hp_printer_pclm.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_hp_printer_pclm_out.pclm", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_hp_printer_pclm.ppd.gz", "printer_add_hp_printer_pclm_out.pclm"}, |
| }, { |
| Name: "hp_ljcolor", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_hp_ljcolor.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_hp_printer_ljcolor_out.pcl", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_hp_ljcolor.ppd.gz", "printer_add_hp_printer_ljcolor_out.pcl"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "hp_pwg_raster_color", |
| Val: &ippprint.Params{ |
| PPDFile: "hp_ipp_everywhere.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_hp_ipp_everywhere_golden.pwg", |
| }, |
| ExtraData: []string{"to_print.pdf", "hp_ipp_everywhere.ppd", "printer_add_hp_ipp_everywhere_golden.pwg"}, |
| }, { |
| Name: "hp_pwg_raster_monochrome", |
| Val: &ippprint.Params{ |
| PPDFile: "hp_ipp_everywhere.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_hp_pwg_raster_monochrome_golden.pwg", |
| Options: []string{"print-color-mode=monochrome"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "hp_ipp_everywhere.ppd", "printer_add_hp_pwg_raster_monochrome_golden.pwg"}, |
| }, { |
| Name: "nec", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_nec_npdl.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_nec_golden.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_nec_npdl.ppd", "printer_add_nec_golden.bin"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "star", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_star_printer_rastertostar.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_star_printer_rastertostar.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_star_printer_rastertostar.ppd.gz", "printer_add_star_printer_rastertostar.bin"}, |
| }, { |
| Name: "star_m", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_star_printer_rastertostarm.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_star_printer_rastertostarm.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_star_printer_rastertostarm.ppd.gz", "printer_add_star_printer_rastertostarm.bin"}, |
| ExtraAttr: []string{"informational"}, |
| }, { |
| Name: "star_lm", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_add_star_printer_rastertostarlm.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_add_star_printer_rastertostarlm.bin", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_add_star_printer_rastertostarlm.ppd.gz", "printer_add_star_printer_rastertostarlm.bin"}, |
| }, { |
| Name: "hp_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_HP.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_hp_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_HP.ppd", "printer_pin_print_hp_no_pin_golden.ps"}, |
| }, { |
| Name: "hp_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_HP.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_hp_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_HP.ppd", "printer_pin_print_hp_pin_golden.ps"}, |
| }, { |
| Name: "lexmark_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Lexmark.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_lexmark_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Lexmark.ppd", "printer_pin_print_lexmark_no_pin_golden.ps"}, |
| }, { |
| Name: "lexmark_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Lexmark.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_lexmark_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Lexmark.ppd", "printer_pin_print_lexmark_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_jobpassword_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_JobPassword.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_JobPassword_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_JobPassword.ppd", "printer_pin_print_ricoh_JobPassword_no_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_jobpassword_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_JobPassword.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_JobPassword_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_JobPassword.ppd", "printer_pin_print_ricoh_JobPassword_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_lockedprintpassword_nopin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_LockedPrintPassword.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_LockedPrintPassword_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_LockedPrintPassword.ppd", "printer_pin_print_ricoh_LockedPrintPassword_no_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_lockedprintpassword_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_LockedPrintPassword.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_LockedPrintPassword_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_LockedPrintPassword.ppd", "printer_pin_print_ricoh_LockedPrintPassword_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_password_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_password.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_password_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_password.ppd", "printer_pin_print_ricoh_password_no_pin_golden.ps"}, |
| }, { |
| Name: "ricoh_password_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Ricoh_password.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_ricoh_password_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Ricoh_password.ppd", "printer_pin_print_ricoh_password_pin_golden.ps"}, |
| }, { |
| Name: "sharp_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Sharp.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_sharp_no_pin_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Sharp.ppd", "printer_pin_print_sharp_no_pin_golden.ps"}, |
| }, { |
| Name: "sharp_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_Sharp.ppd", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_sharp_pin_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_Sharp.ppd", "printer_pin_print_sharp_pin_golden.ps"}, |
| }, { |
| Name: "unsupported_no_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_unsupported_GenericPostScript.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_unsupported_golden.ps", |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_unsupported_GenericPostScript.ppd.gz", "printer_pin_print_unsupported_golden.ps"}, |
| }, { |
| Name: "unsupported_pin", |
| Val: &ippprint.Params{ |
| PPDFile: "printer_unsupported_GenericPostScript.ppd.gz", |
| PrintFile: "to_print.pdf", |
| ExpectedFile: "printer_pin_print_unsupported_golden.ps", |
| Options: []string{"job-password=1234"}, |
| }, |
| ExtraData: []string{"to_print.pdf", "printer_unsupported_GenericPostScript.ppd.gz", "printer_pin_print_unsupported_golden.ps"}, |
| }, |
| }, |
| }) |
| } |
| |
| func ProxyAdd(ctx context.Context, s *testing.State) { |
| ippprint.ProxyRun(ctx, s, s.Param().(*ippprint.Params)) |
| } |