third_party/libusb/webport/src/libusb_over_chrome_usb_unittest.cc
TEST_P(LibusbOverChromeUsbSingleTransferTest, AsyncControlTransfer) {
  const std::function<void()> chrome_usb_transfer_resolver =
      SetUpMockForAsyncControlTransfer(GetParam().transfer_index,
                                       GetParam().is_transfer_output);

  MockFunction<void(libusb_transfer_status)> transfer_callback;
  StartAsyncControlTransfer(GetParam().transfer_index,
                            GetParam().is_transfer_output, &transfer_callback);

  chrome_usb_transfer_resolver();

  ASSERT_TRUE(Mock::VerifyAndClearExpectations(&transfer_callback));
  SetUpTransferCallbackMockExpectations(GetParam().transfer_index, false,
                                        &transfer_callback);
  libusb_over_chrome_usb->LibusbHandleEvents(nullptr);
}
// Test a simple asynchronous control transfer.
//
// The transfer request is resolved on the same thread that initiated the
// transfer, before the libusb events handling starts.
Test a simple asynchronous control transfer.
The transfer request is resolved on the same thread that initiated the
transfer, before the libusb events handling starts.
Test a simple asynchronous control transfer . The transfer request is resolved on the same thread that initiated the transfer before the libusb events handling starts .
TEST_P(LibusbOverChromeUsbSingleTransferTest, AsyncControlTransfer) {
  const std::function<void()> chrome_usb_transfer_resolver =
      SetUpMockForAsyncControlTransfer(GetParam().transfer_index,
                                       GetParam().is_transfer_output);
  MockFunction<void(libusb_transfer_status)> transfer_callback;
  StartAsyncControlTransfer(GetParam().transfer_index,
                            GetParam().is_transfer_output, &transfer_callback);
  chrome_usb_transfer_resolver();
  ASSERT_TRUE(Mock::VerifyAndClearExpectations(&transfer_callback));
  SetUpTransferCallbackMockExpectations(GetParam().transfer_index, false,
                                        &transfer_callback);
  libusb_over_chrome_usb->LibusbHandleEvents(nullptr);
}
TEST_P ( LibusbOverChromeUsbSingleTransferTest , AsyncControlTransfer ) { const std :: function < void ( ) > chrome_usb_transfer_resolver = SetUpMockForAsyncControlTransfer ( GetParam ( ) . transfer_index , GetParam ( ) . is_transfer_output ) ; MockFunction < void ( libusb_transfer_status ) > transfer_callback ; StartAsyncControlTransfer ( GetParam ( ) . transfer_index , GetParam ( ) . is_transfer_output , & transfer_callback ) ; chrome_usb_transfer_resolver ( ) ; ASSERT_TRUE ( Mock :: VerifyAndClearExpectations ( & transfer_callback ) ) ; SetUpTransferCallbackMockExpectations ( GetParam ( ) . transfer_index , false , & transfer_callback ) ; libusb_over_chrome_usb -> LibusbHandleEvents ( nullptr ) ; }
Test a simple asynchronous control transfer.
Test a simple asynchronous control transfer .