TestPrintBackend cleanup & enhancements
The TestPrintBackend class has been a minimal implementation of a PrintBackend that could be used in a limited fashion for focused unit tests. It did not behave in a consistent fashion between the various interfaces; for example, setting a new default printer would not be reflected when getting PrinterBasicInfo. The out-of-process print driver feature is intending to use this class in a more general manner, for use of fake printer drivers in browser tests. This makes it desirable to make this class be better behaved. Introduce unit tests specifically for TestPrintBackend, to provide confidence for use by larger browser tests. Ensure that the same mapping of available printers is used across the PrintBackend APIs, so that calls to get printer info or capabilities would be guaranteed available for any printer identified by EnumeratePrinters(). Also ensure that the default printer is kept consistent when the environment is generated or later modified. Updated PrintBackend::PrinterBasicInfo class to have a fully-parameterized constructor and equality operator to assist with unit tests here as well as in the forthcoming tests for later OOPPD changes. Bug: 809738 Change-Id: Ia35e0c99bdb0eba8faa48dfc955d73a816e7d84d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463559 Commit-Queue: Alan Screen <awscreen@chromium.org> Reviewed-by:Lei Zhang <thestig@chromium.org> Reviewed-by:
Daniel Hosseinian <dhoss@chromium.org> Cr-Commit-Position: refs/heads/master@{#827566}
Showing
Please register or sign in to comment