Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_browsertest.cc

Issue 1265833005: Get all the UsbConfigDescriptor for the device configuration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use const auto Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698