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

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_browsertest.cc

Issue 1618393004: Update device/usb and its Mojo interface for variable size ISO packets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 std::copy(output_buffer_.begin(), 344 std::copy(output_buffer_.begin(),
345 output_buffer_.begin() + query.size, 345 output_buffer_.begin() + query.size,
346 query.buffer->data()); 346 query.buffer->data());
347 output_buffer_.erase(output_buffer_.begin(), 347 output_buffer_.erase(output_buffer_.begin(),
348 output_buffer_.begin() + query.size); 348 output_buffer_.begin() + query.size);
349 base::ThreadTaskRunnerHandle::Get()->PostTask( 349 base::ThreadTaskRunnerHandle::Get()->PostTask(
350 FROM_HERE, base::Bind(query.callback, device::USB_TRANSFER_COMPLETED, 350 FROM_HERE, base::Bind(query.callback, device::USB_TRANSFER_COMPLETED,
351 query.buffer, query.size)); 351 query.buffer, query.size));
352 } 352 }
353 353
354 void IsochronousTransfer(UsbEndpointDirection direction, 354 void IsochronousTransferIn(
355 uint8_t endpoint, 355 uint8_t endpoint_number,
356 scoped_refptr<net::IOBuffer> buffer, 356 const std::vector<uint32_t>& packet_lengths,
357 size_t length, 357 unsigned int timeout,
358 unsigned int packets, 358 const IsochronousTransferCallback& callback) override {}
359 unsigned int packet_length, 359
360 unsigned int timeout, 360 void IsochronousTransferOut(
361 const TransferCallback& callback) override {} 361 uint8_t endpoint_number,
362 scoped_refptr<net::IOBuffer> buffer,
363 const std::vector<uint32_t>& packet_lengths,
364 unsigned int timeout,
365 const IsochronousTransferCallback& callback) override {}
362 366
363 protected: 367 protected:
364 virtual ~MockUsbDeviceHandle() {} 368 virtual ~MockUsbDeviceHandle() {}
365 369
366 struct Query { 370 struct Query {
367 TransferCallback callback; 371 TransferCallback callback;
368 scoped_refptr<net::IOBuffer> buffer; 372 scoped_refptr<net::IOBuffer> buffer;
369 size_t size; 373 size_t size;
370 374
371 Query(TransferCallback callback, 375 Query(TransferCallback callback,
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 EXPECT_EQ(2, listener.invoked_); 799 EXPECT_EQ(2, listener.invoked_);
796 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); 800 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_);
797 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); 801 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
798 } 802 }
799 803
800 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { 804 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) {
801 MockCountListenerForCheckingTraits listener(adb_bridge_); 805 MockCountListenerForCheckingTraits listener(adb_bridge_);
802 adb_bridge_->AddDeviceCountListener(&listener); 806 adb_bridge_->AddDeviceCountListener(&listener);
803 runner_->Run(); 807 runner_->Run();
804 } 808 }
OLDNEW
« no previous file with comments | « no previous file | device/devices_app/usb/device_impl.h » ('j') | device/devices_app/usb/type_converters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698