| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/containers/scoped_ptr_hash_map.h" | 7 #include "base/containers/scoped_ptr_hash_map.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 408 |
| 409 config_desc_.interfaces.push_back(interface_desc); | 409 config_desc_.interfaces.push_back(interface_desc); |
| 410 } | 410 } |
| 411 | 411 |
| 412 void Open(const OpenCallback& callback) override { | 412 void Open(const OpenCallback& callback) override { |
| 413 base::ThreadTaskRunnerHandle::Get()->PostTask( | 413 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 414 FROM_HERE, base::Bind(callback, make_scoped_refptr( | 414 FROM_HERE, base::Bind(callback, make_scoped_refptr( |
| 415 new MockUsbDeviceHandle<T>(this)))); | 415 new MockUsbDeviceHandle<T>(this)))); |
| 416 } | 416 } |
| 417 | 417 |
| 418 const UsbConfigDescriptor* GetConfiguration() override { | 418 const UsbConfigDescriptor* GetActiveConfiguration() override { |
| 419 return T::kConfigured ? &config_desc_ : nullptr; | 419 return T::kConfigured ? &config_desc_ : nullptr; |
| 420 } | 420 } |
| 421 | 421 |
| 422 bool Close(scoped_refptr<UsbDeviceHandle> handle) override { | 422 bool Close(scoped_refptr<UsbDeviceHandle> handle) override { |
| 423 return true; | 423 return true; |
| 424 } | 424 } |
| 425 | 425 |
| 426 std::set<int> claimed_interfaces_; | 426 std::set<int> claimed_interfaces_; |
| 427 | 427 |
| 428 protected: | 428 protected: |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 EXPECT_EQ(2, listener.invoked_); | 777 EXPECT_EQ(2, listener.invoked_); |
| 778 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); | 778 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); |
| 779 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 779 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
| 780 } | 780 } |
| 781 | 781 |
| 782 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { | 782 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { |
| 783 MockCountListenerForCheckingTraits listener(adb_bridge_); | 783 MockCountListenerForCheckingTraits listener(adb_bridge_); |
| 784 adb_bridge_->AddDeviceCountListener(&listener); | 784 adb_bridge_->AddDeviceCountListener(&listener); |
| 785 runner_->Run(); | 785 runner_->Run(); |
| 786 } | 786 } |
| OLD | NEW |