Commit 6ea0bf09 authored by Alan Screen's avatar Alan Screen Committed by Commit Bot

Remove unused TestPrintBackend API

The PopulatePrinterList() interface is not used anywhere, and can be
deleted.

The method to provide meaningful data back to tests which use this class
should be improved to be consistent by other changes to
TestPrintBackend, so that tests which use
PrintBackend::EnumeratePrinters() can get something meaningful.

Bug: 809738
Change-Id: I9da77434456ca9af4c75928b8465966f23cbed1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469230
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817166}
parent 1d75801c
......@@ -17,12 +17,11 @@ TestPrintBackend::TestPrintBackend() : PrintBackend(/*locale=*/std::string()) {}
TestPrintBackend::~TestPrintBackend() = default;
bool TestPrintBackend::EnumeratePrinters(PrinterList* printer_list) {
if (printer_list_.empty())
return false;
printer_list->insert(printer_list->end(), printer_list_.begin(),
printer_list_.end());
return true;
// TODO(crbug.com/809738) There was never a call to provide a list of
// printers for the environment, so this would always be empty.
// This needs to be updated as part of a larger cleanup to make
// TestPrintBackend have consistent behavior across its APIs.
return false;
}
std::string TestPrintBackend::GetDefaultPrinterName() {
......@@ -67,11 +66,6 @@ bool TestPrintBackend::IsValidPrinter(const std::string& printer_name) {
return base::Contains(valid_printers_, printer_name);
}
void TestPrintBackend::PopulatePrinterList(const PrinterList& printer_list) {
printer_list_.insert(printer_list_.end(), printer_list.begin(),
printer_list.end());
}
void TestPrintBackend::SetDefaultPrinterName(const std::string& printer_name) {
default_printer_name_ = printer_name;
}
......
......@@ -33,10 +33,6 @@ class TestPrintBackend : public PrintBackend {
std::string GetPrinterDriverInfo(const std::string& printer_name) override;
bool IsValidPrinter(const std::string& printer_name) override;
// Methods for test setup.
// Add printers to the list returned by EnumeratePrinters.
void PopulatePrinterList(const PrinterList& printer_list);
// Set a default printer. The default is the empty string.
void SetDefaultPrinterName(const std::string& printer_name);
......@@ -50,7 +46,6 @@ class TestPrintBackend : public PrintBackend {
private:
std::string default_printer_name_;
PrinterList printer_list_;
std::map<std::string, std::unique_ptr<PrinterSemanticCapsAndDefaults>>
valid_printers_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment