| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/printer_detector/printer_detector.h" | 5 #include "chrome/browser/chromeos/printer_detector/printer_detector.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // device::UsbDevice overrides: | 66 // device::UsbDevice overrides: |
| 67 void Open(const OpenCallback& callback) override { | 67 void Open(const OpenCallback& callback) override { |
| 68 ADD_FAILURE() << "Not reached"; | 68 ADD_FAILURE() << "Not reached"; |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool Close(scoped_refptr<device::UsbDeviceHandle> handle) override { | 71 bool Close(scoped_refptr<device::UsbDeviceHandle> handle) override { |
| 72 ADD_FAILURE() << "Not reached"; | 72 ADD_FAILURE() << "Not reached"; |
| 73 return false; | 73 return false; |
| 74 } | 74 } |
| 75 | 75 |
| 76 const device::UsbConfigDescriptor* GetConfiguration() override { | 76 const device::UsbConfigDescriptor* GetCurrentConfiguration() override { |
| 77 return config_.get(); | 77 return config_.get(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 const std::vector<device::UsbConfigDescriptor>& configurations() |
| 81 const override { |
| 82 return configurations_; |
| 83 } |
| 84 |
| 80 scoped_ptr<device::UsbConfigDescriptor> config_; | 85 scoped_ptr<device::UsbConfigDescriptor> config_; |
| 86 std::vector<device::UsbConfigDescriptor> configurations_; |
| 81 | 87 |
| 82 DISALLOW_COPY_AND_ASSIGN(FakeUsbDevice); | 88 DISALLOW_COPY_AND_ASSIGN(FakeUsbDevice); |
| 83 }; | 89 }; |
| 84 | 90 |
| 85 class FakeDeviceClient : public device::DeviceClient { | 91 class FakeDeviceClient : public device::DeviceClient { |
| 86 public: | 92 public: |
| 87 FakeDeviceClient() : usb_service_(nullptr) {} | 93 FakeDeviceClient() : usb_service_(nullptr) {} |
| 88 | 94 |
| 89 ~FakeDeviceClient() override {} | 95 ~FakeDeviceClient() override {} |
| 90 | 96 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 .Set("interfaceClass", kPrinterInterfaceClass)))).Pass(); | 367 .Set("interfaceClass", kPrinterInterfaceClass)))).Pass(); |
| 362 ASSERT_TRUE(extensions::ExtensionRegistry::Get(profile_.get()) | 368 ASSERT_TRUE(extensions::ExtensionRegistry::Get(profile_.get()) |
| 363 ->AddEnabled(extension)); | 369 ->AddEnabled(extension)); |
| 364 | 370 |
| 365 InvokeUsbAdded(123, 456, 1); | 371 InvokeUsbAdded(123, 456, 1); |
| 366 | 372 |
| 367 ASSERT_EQ(0u, notification_ui_manager_.GetNotificationCount()); | 373 ASSERT_EQ(0u, notification_ui_manager_.GetNotificationCount()); |
| 368 } | 374 } |
| 369 | 375 |
| 370 } // namespace chromeos | 376 } // namespace chromeos |
| OLD | NEW |