Remove APIPermission::kFileSystemWriteDirectory
[chromium-blink-merge.git] / tools / usb_gadget / echo_gadget_test.py
bloba25d68cb233260144e4e3ede93adc0857b8bd69c
1 #!/usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import unittest
8 import mock
10 import echo_gadget
11 import usb_constants
14 class EchoGadgetTest(unittest.TestCase):
16 def test_bulk_echo(self):
17 g = echo_gadget.EchoGadget()
18 chip = mock.Mock()
19 g.Connected(chip, usb_constants.Speed.HIGH)
20 g.SetConfiguration(1)
21 g.ReceivePacket(0x02, 'Hello world!')
22 chip.SendPacket.assert_called_once_with(0x82, 'Hello world!')