| OLD | NEW |
| 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 "device/usb/usb_device_handle.h" | 5 #include "device/usb/usb_device_handle.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace device { | 23 namespace device { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class UsbDeviceHandleTest : public ::testing::Test { | 27 class UsbDeviceHandleTest : public ::testing::Test { |
| 28 public: | 28 public: |
| 29 UsbDeviceHandleTest() | 29 UsbDeviceHandleTest() |
| 30 : io_thread_(base::TestIOThread::kAutoStart), | 30 : io_thread_(base::TestIOThread::kAutoStart), |
| 31 scoped_task_environment_( | 31 scoped_task_environment_( |
| 32 base::test::ScopedTaskEnvironment::MainThreadType::UI), | 32 base::test::ScopedTaskEnvironment::MainThreadType::UI) {} |
| 33 device_client_(io_thread_.task_runner()) {} | |
| 34 | 33 |
| 35 protected: | 34 protected: |
| 36 base::TestIOThread io_thread_; | 35 base::TestIOThread io_thread_; |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 base::test::ScopedTaskEnvironment scoped_task_environment_; | 38 base::test::ScopedTaskEnvironment scoped_task_environment_; |
| 40 TestDeviceClient device_client_; | 39 TestDeviceClient device_client_; |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 class TestOpenCallback { | 42 class TestOpenCallback { |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 10, // 10 millisecond timeout | 445 10, // 10 millisecond timeout |
| 447 base::Bind(&ExpectTimeoutAndClose, handle, run_loop.QuitClosure())); | 446 base::Bind(&ExpectTimeoutAndClose, handle, run_loop.QuitClosure())); |
| 448 // Drop handle so that the completion callback holds the last reference. | 447 // Drop handle so that the completion callback holds the last reference. |
| 449 handle = nullptr; | 448 handle = nullptr; |
| 450 run_loop.Run(); | 449 run_loop.Run(); |
| 451 } | 450 } |
| 452 | 451 |
| 453 } // namespace | 452 } // namespace |
| 454 | 453 |
| 455 } // namespace device | 454 } // namespace device |
| OLD | NEW |