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 <queue> | 5 #include <queue> |
6 #include <string> | 6 #include <string> |
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 pending_printers_callbacks_; | 434 pending_printers_callbacks_; |
435 std::queue<PrinterProviderAPI::GetCapabilityCallback> | 435 std::queue<PrinterProviderAPI::GetCapabilityCallback> |
436 pending_capability_callbacks_; | 436 pending_capability_callbacks_; |
437 std::queue<PrintRequestInfo> pending_print_requests_; | 437 std::queue<PrintRequestInfo> pending_print_requests_; |
438 std::queue<PrinterProviderAPI::GetPrinterInfoCallback> | 438 std::queue<PrinterProviderAPI::GetPrinterInfoCallback> |
439 pending_usb_info_callbacks_; | 439 pending_usb_info_callbacks_; |
440 | 440 |
441 DISALLOW_COPY_AND_ASSIGN(FakePrinterProviderAPI); | 441 DISALLOW_COPY_AND_ASSIGN(FakePrinterProviderAPI); |
442 }; | 442 }; |
443 | 443 |
444 KeyedService* BuildTestingPrinterProviderAPI(content::BrowserContext* context) { | 444 scoped_ptr<KeyedService> BuildTestingPrinterProviderAPI( |
445 return new FakePrinterProviderAPI(); | 445 content::BrowserContext* context) { |
| 446 return make_scoped_ptr(new FakePrinterProviderAPI()); |
446 } | 447 } |
447 | 448 |
448 class FakeDeviceClient : public device::DeviceClient { | 449 class FakeDeviceClient : public device::DeviceClient { |
449 public: | 450 public: |
450 FakeDeviceClient() {} | 451 FakeDeviceClient() {} |
451 | 452 |
452 // device::DeviceClient implementation: | 453 // device::DeviceClient implementation: |
453 device::UsbService* GetUsbService() override { | 454 device::UsbService* GetUsbService() override { |
454 DCHECK(usb_service_); | 455 DCHECK(usb_service_); |
455 return usb_service_; | 456 return usb_service_; |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 DictionaryBuilder() | 1018 DictionaryBuilder() |
1018 .Set("id", "printer1") | 1019 .Set("id", "printer1") |
1019 .Set("name", "Printer 1") | 1020 .Set("name", "Printer 1") |
1020 .Build()); | 1021 .Build()); |
1021 | 1022 |
1022 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info); | 1023 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info); |
1023 | 1024 |
1024 EXPECT_EQ(0u, call_count); | 1025 EXPECT_EQ(0u, call_count); |
1025 EXPECT_FALSE(printer_info.get()); | 1026 EXPECT_FALSE(printer_info.get()); |
1026 } | 1027 } |
OLD | NEW |