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

Unified Diff: device/test/usb_test_gadget_impl.cc

Issue 804643002: Enable USB gadget tests on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/test/usb_test_gadget.h ('k') | device/usb/usb_device_handle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/test/usb_test_gadget_impl.cc
diff --git a/device/test/usb_test_gadget_impl.cc b/device/test/usb_test_gadget_impl.cc
index d2272df5952bb6a85d9ddc9ef80095439649760a..0e8aa7477426388fb941e1be62b9676b2e51a42e 100644
--- a/device/test/usb_test_gadget_impl.cc
+++ b/device/test/usb_test_gadget_impl.cc
@@ -71,7 +71,7 @@ class UsbTestGadgetImpl : public UsbTestGadget {
bool Reconnect() override;
bool SetType(Type type) override;
UsbDevice* GetDevice() const override;
- std::string GetSerialNumber() const override;
+ const std::string& GetSerialNumber() const override;
protected:
UsbTestGadgetImpl();
@@ -166,7 +166,7 @@ UsbDevice* UsbTestGadgetImpl::GetDevice() const {
return device_.get();
}
-std::string UsbTestGadgetImpl::GetSerialNumber() const {
+const std::string& UsbTestGadgetImpl::GetSerialNumber() const {
return device_address_;
}
@@ -176,10 +176,8 @@ scoped_ptr<net::URLFetcher> UsbTestGadgetImpl::CreateURLFetcher(
scoped_ptr<net::URLFetcher> url_fetcher(
net::URLFetcher::Create(url, request_type, delegate));
- url_fetcher->SetRequestContext(
- new net::TrivialURLRequestContextGetter(
- request_context_.get(),
- base::MessageLoop::current()->message_loop_proxy()));
+ url_fetcher->SetRequestContext(new net::TrivialURLRequestContextGetter(
+ request_context_.get(), base::MessageLoop::current()->task_runner()));
return url_fetcher;
}
@@ -426,6 +424,8 @@ bool UsbTestGadgetImpl::Unclaim() {
LOG(ERROR) << "Unexpected HTTP " << response_code << " from /unclaim.";
return false;
}
+
+ device_address_.clear();
return true;
}
« no previous file with comments | « device/test/usb_test_gadget.h ('k') | device/usb/usb_device_handle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698