Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/browser/chromeos/printer_detector/printer_detector_unittest.cc

Issue 1265833005: Get all the UsbConfigDescriptor for the device configuration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated chromeos related code again Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/device/usb/android_usb_browsertest.cc » ('j') | device/usb/usb_device.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698