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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | |
8 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> |
9 | 9 |
10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" | 15 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" |
16 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | 16 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
17 #include "chrome/browser/devtools/device/usb/android_usb_device.h" | 17 #include "chrome/browser/devtools/device/usb/android_usb_device.h" |
18 #include "chrome/browser/devtools/device/usb/usb_device_provider.h" | 18 #include "chrome/browser/devtools/device/usb/usb_device_provider.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 callback.Run(devices); | 503 callback.Run(devices); |
504 } | 504 } |
505 | 505 |
506 private: | 506 private: |
507 int step_; | 507 int step_; |
508 }; | 508 }; |
509 | 509 |
510 class TestDeviceClient : public DeviceClient { | 510 class TestDeviceClient : public DeviceClient { |
511 public: | 511 public: |
512 explicit TestDeviceClient(scoped_ptr<UsbService> service) | 512 explicit TestDeviceClient(scoped_ptr<UsbService> service) |
513 : DeviceClient(), usb_service_(service.Pass()) {} | 513 : DeviceClient(), usb_service_(std::move(service)) {} |
514 ~TestDeviceClient() override {} | 514 ~TestDeviceClient() override {} |
515 | 515 |
516 private: | 516 private: |
517 UsbService* GetUsbService() override { return usb_service_.get(); } | 517 UsbService* GetUsbService() override { return usb_service_.get(); } |
518 | 518 |
519 scoped_ptr<UsbService> usb_service_; | 519 scoped_ptr<UsbService> usb_service_; |
520 }; | 520 }; |
521 | 521 |
522 class DevToolsAndroidBridgeWarmUp | 522 class DevToolsAndroidBridgeWarmUp |
523 : public DevToolsAndroidBridge::DeviceCountListener { | 523 : public DevToolsAndroidBridge::DeviceCountListener { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 EXPECT_EQ(2, listener.invoked_); | 799 EXPECT_EQ(2, listener.invoked_); |
800 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); | 800 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); |
801 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 801 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
802 } | 802 } |
803 | 803 |
804 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { | 804 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { |
805 MockCountListenerForCheckingTraits listener(adb_bridge_); | 805 MockCountListenerForCheckingTraits listener(adb_bridge_); |
806 adb_bridge_->AddDeviceCountListener(&listener); | 806 adb_bridge_->AddDeviceCountListener(&listener); |
807 runner_->Run(); | 807 runner_->Run(); |
808 } | 808 } |
OLD | NEW |