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

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: Document use of ErrorWithArguments. Created 4 years, 10 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
« no previous file with comments | « no previous file | device/devices_app/usb/device_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 std::copy(output_buffer_.begin(), 345 std::copy(output_buffer_.begin(),
346 output_buffer_.begin() + query.size, 346 output_buffer_.begin() + query.size,
347 query.buffer->data()); 347 query.buffer->data());
348 output_buffer_.erase(output_buffer_.begin(), 348 output_buffer_.erase(output_buffer_.begin(),
349 output_buffer_.begin() + query.size); 349 output_buffer_.begin() + query.size);
350 base::ThreadTaskRunnerHandle::Get()->PostTask( 350 base::ThreadTaskRunnerHandle::Get()->PostTask(
351 FROM_HERE, base::Bind(query.callback, device::USB_TRANSFER_COMPLETED, 351 FROM_HERE, base::Bind(query.callback, device::USB_TRANSFER_COMPLETED,
352 query.buffer, query.size)); 352 query.buffer, query.size));
353 } 353 }
354 354
355 void IsochronousTransfer(UsbEndpointDirection direction, 355 void IsochronousTransferIn(
356 uint8_t endpoint, 356 uint8_t endpoint_number,
357 scoped_refptr<net::IOBuffer> buffer, 357 const std::vector<uint32_t>& packet_lengths,
358 size_t length, 358 unsigned int timeout,
359 unsigned int packets, 359 const IsochronousTransferCallback& callback) override {}
360 unsigned int packet_length, 360
361 unsigned int timeout, 361 void IsochronousTransferOut(
362 const TransferCallback& callback) override {} 362 uint8_t endpoint_number,
363 scoped_refptr<net::IOBuffer> buffer,
364 const std::vector<uint32_t>& packet_lengths,
365 unsigned int timeout,
366 const IsochronousTransferCallback& callback) override {}
363 367
364 protected: 368 protected:
365 virtual ~MockUsbDeviceHandle() {} 369 virtual ~MockUsbDeviceHandle() {}
366 370
367 struct Query { 371 struct Query {
368 TransferCallback callback; 372 TransferCallback callback;
369 scoped_refptr<net::IOBuffer> buffer; 373 scoped_refptr<net::IOBuffer> buffer;
370 size_t size; 374 size_t size;
371 375
372 Query(TransferCallback callback, 376 Query(TransferCallback callback,
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 EXPECT_EQ(2, listener.invoked_); 800 EXPECT_EQ(2, listener.invoked_);
797 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); 801 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_);
798 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); 802 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
799 } 803 }
800 804
801 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { 805 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) {
802 MockCountListenerForCheckingTraits listener(adb_bridge_); 806 MockCountListenerForCheckingTraits listener(adb_bridge_);
803 adb_bridge_->AddDeviceCountListener(&listener); 807 adb_bridge_->AddDeviceCountListener(&listener);
804 runner_->Run(); 808 runner_->Run();
805 } 809 }
OLDNEW
« no previous file with comments | « no previous file | device/devices_app/usb/device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698