Chromium Code Reviews| Index: chrome/browser/printing/print_system_task_proxy_unittest.cc |
| =================================================================== |
| --- chrome/browser/printing/print_system_task_proxy_unittest.cc (revision 110200) |
| +++ chrome/browser/printing/print_system_task_proxy_unittest.cc (working copy) |
| @@ -221,3 +221,42 @@ |
| cupsFreeOptions(num_options, options); |
| } |
| } |
| + |
| +// Test duplex detection code, which regressed in http://crbug.com/103999. |
| +TEST(PrintSystemTaskProxyTest, DetectDuplexModeCUPS) { |
|
kmadhusu
2011/11/16 20:43:29
Can you add another test for windows duplex settin
Lei Zhang
2011/11/17 00:20:16
That's beyond the scope of this CL.
kmadhusu
2011/11/17 01:03:00
From my understanding, the purpose of this CL to a
|
| + // Specifies the test ppd data. |
| + printing::PrinterCapsAndDefaults printer_info; |
| + printer_info.printer_capabilities.append( |
| + "*PPD-Adobe: \"4.3\"\n\n" |
| + "*OpenGroup: General/General\n\n" |
| + "*OpenUI *Duplex/Double-Sided Printing: PickOne\n" |
| + "*DefaultDuplex: None\n" |
| + "*Duplex None/Off: " |
| + "\"<</Duplex false>>setpagedevice\"\n" |
| + "*Duplex DuplexNoTumble/Long Edge (Standard): " |
| + "\"<</Duplex true/Tumble false>>setpagedevice\"\n" |
| + "*Duplex DuplexTumble/Short Edge (Flip): " |
| + "\"<</Duplex true/Tumble true>>setpagedevice\"\n" |
| + "*CloseUI: *Duplex\n\n" |
| + "*CloseGroup: General\n"); |
| + |
|
kmadhusu
2011/11/16 20:43:29
nit: remove blank line
Lei Zhang
2011/11/17 00:20:16
Done.
|
| + |
| + bool set_color_as_default = false; |
| + bool set_duplex_as_default = false; |
| + int printer_color_space_for_color = printing::UNKNOWN_COLOR_MODEL; |
| + int printer_color_space_for_black = printing::UNKNOWN_COLOR_MODEL; |
| + int default_duplex_setting_value = printing::UNKNOWN_DUPLEX_MODE; |
| + |
| + scoped_refptr<PrintSystemTaskProxy> test_proxy; |
| + bool res = test_proxy->GetPrinterCapabilitiesCUPS( |
| + printer_info, |
| + "InvalidPrinter", |
| + &set_color_as_default, |
| + &printer_color_space_for_color, |
| + &printer_color_space_for_black, |
| + &set_duplex_as_default, |
| + &default_duplex_setting_value); |
| + ASSERT_TRUE(res); |
| + EXPECT_FALSE(set_duplex_as_default); |
| + EXPECT_EQ(printing::SIMPLEX, default_duplex_setting_value); |
|
kmadhusu
2011/11/16 20:43:29
Can you add another test to verify that a ppd with
Lei Zhang
2011/11/17 00:20:16
Done.
|
| +} |