| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void DispatchPrintRequested( | 348 void DispatchPrintRequested( |
| 349 const PrinterProviderPrintJob& job, | 349 const PrinterProviderPrintJob& job, |
| 350 const PrinterProviderAPI::PrintCallback& callback) override { | 350 const PrinterProviderAPI::PrintCallback& callback) override { |
| 351 PrintRequestInfo request_info; | 351 PrintRequestInfo request_info; |
| 352 request_info.callback = callback; | 352 request_info.callback = callback; |
| 353 request_info.job = job; | 353 request_info.job = job; |
| 354 | 354 |
| 355 pending_print_requests_.push_back(request_info); | 355 pending_print_requests_.push_back(request_info); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void DispatchGetUsbPrinterInfoRequested( |
| 359 const std::string& extension_id, |
| 360 scoped_refptr<device::UsbDevice> device, |
| 361 const PrinterProviderAPI::GetPrinterInfoCallback& callback) override { |
| 362 ADD_FAILURE() << "Not reached."; |
| 363 } |
| 364 |
| 358 size_t pending_get_printers_count() const { | 365 size_t pending_get_printers_count() const { |
| 359 return pending_printers_callbacks_.size(); | 366 return pending_printers_callbacks_.size(); |
| 360 } | 367 } |
| 361 | 368 |
| 362 const PrinterProviderPrintJob* GetPrintJob( | 369 const PrinterProviderPrintJob* GetPrintJob( |
| 363 const extensions::Extension* extension, | 370 const extensions::Extension* extension, |
| 364 int request_id) const override { | 371 int request_id) const override { |
| 365 ADD_FAILURE() << "Not reached"; | 372 ADD_FAILURE() << "Not reached"; |
| 366 return nullptr; | 373 return nullptr; |
| 367 } | 374 } |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 extension_printer_handler_->StartPrint( | 929 extension_printer_handler_->StartPrint( |
| 923 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title, | 930 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title, |
| 924 kEmptyPrintTicket, gfx::Size(100, 100), print_data, | 931 kEmptyPrintTicket, gfx::Size(100, 100), print_data, |
| 925 base::Bind(&RecordPrintResult, &call_count, &success, &status)); | 932 base::Bind(&RecordPrintResult, &call_count, &success, &status)); |
| 926 | 933 |
| 927 EXPECT_EQ(1u, call_count); | 934 EXPECT_EQ(1u, call_count); |
| 928 | 935 |
| 929 EXPECT_FALSE(success); | 936 EXPECT_FALSE(success); |
| 930 EXPECT_EQ("INVALID_DATA", status); | 937 EXPECT_EQ("INVALID_DATA", status); |
| 931 } | 938 } |
| OLD | NEW |