Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 void DispatchPrintRequested( | 290 void DispatchPrintRequested( |
| 291 const PrinterProviderPrintJob& job, | 291 const PrinterProviderPrintJob& job, |
| 292 const PrinterProviderAPI::PrintCallback& callback) override { | 292 const PrinterProviderAPI::PrintCallback& callback) override { |
| 293 PrintRequestInfo request_info; | 293 PrintRequestInfo request_info; |
| 294 request_info.callback = callback; | 294 request_info.callback = callback; |
| 295 request_info.job = job; | 295 request_info.job = job; |
| 296 | 296 |
| 297 pending_print_requests_.push_back(request_info); | 297 pending_print_requests_.push_back(request_info); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void DispatchGetUsbPrinterInfoRequested( | |
| 301 const std::string& extension_id, | |
| 302 scoped_refptr<device::UsbDevice> device, | |
| 303 const PrinterProviderAPI::GetPrinterInfoCallback& callback) override { | |
| 304 NOTREACHED(); | |
|
tbarzic
2015/05/28 22:20:50
s/NOTREACHED()/ADD_FAILURE() << "Not reached"/
(I
Reilly Grant (use Gerrit)
2015/05/28 22:38:57
Done.
| |
| 305 } | |
| 306 | |
| 300 size_t pending_get_printers_count() const { | 307 size_t pending_get_printers_count() const { |
| 301 return pending_printers_callbacks_.size(); | 308 return pending_printers_callbacks_.size(); |
| 302 } | 309 } |
| 303 | 310 |
| 304 const PrinterProviderPrintJob* GetPrintJob( | 311 const PrinterProviderPrintJob* GetPrintJob( |
| 305 const extensions::Extension* extension, | 312 const extensions::Extension* extension, |
| 306 int request_id) const override { | 313 int request_id) const override { |
| 307 ADD_FAILURE() << "Not reached"; | 314 ADD_FAILURE() << "Not reached"; |
| 308 return nullptr; | 315 return nullptr; |
| 309 } | 316 } |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 extension_printer_handler_->StartPrint( | 794 extension_printer_handler_->StartPrint( |
| 788 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title, | 795 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title, |
| 789 kEmptyPrintTicket, gfx::Size(100, 100), print_data, | 796 kEmptyPrintTicket, gfx::Size(100, 100), print_data, |
| 790 base::Bind(&RecordPrintResult, &call_count, &success, &status)); | 797 base::Bind(&RecordPrintResult, &call_count, &success, &status)); |
| 791 | 798 |
| 792 EXPECT_EQ(1u, call_count); | 799 EXPECT_EQ(1u, call_count); |
| 793 | 800 |
| 794 EXPECT_FALSE(success); | 801 EXPECT_FALSE(success); |
| 795 EXPECT_EQ("INVALID_DATA", status); | 802 EXPECT_EQ("INVALID_DATA", status); |
| 796 } | 803 } |
| OLD | NEW |