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

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

Issue 1565313002: Reland of Implement basic USB device enumeration on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dependency fix added to reland. Created 4 years, 11 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
« no previous file with comments | « no previous file | content/app/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 void Open(const OpenCallback& callback) override { 420 void Open(const OpenCallback& callback) override {
421 base::ThreadTaskRunnerHandle::Get()->PostTask( 421 base::ThreadTaskRunnerHandle::Get()->PostTask(
422 FROM_HERE, base::Bind(callback, make_scoped_refptr( 422 FROM_HERE, base::Bind(callback, make_scoped_refptr(
423 new MockUsbDeviceHandle<T>(this)))); 423 new MockUsbDeviceHandle<T>(this))));
424 } 424 }
425 425
426 const UsbConfigDescriptor* GetActiveConfiguration() override { 426 const UsbConfigDescriptor* GetActiveConfiguration() override {
427 return T::kConfigured ? &config_desc_ : nullptr; 427 return T::kConfigured ? &config_desc_ : nullptr;
428 } 428 }
429 429
430 bool Close(scoped_refptr<UsbDeviceHandle> handle) override {
431 return true;
432 }
433
434 std::set<int> claimed_interfaces_; 430 std::set<int> claimed_interfaces_;
435 431
436 protected: 432 protected:
437 virtual ~MockUsbDevice() {} 433 virtual ~MockUsbDevice() {}
438 434
439 private: 435 private:
440 UsbConfigDescriptor config_desc_; 436 UsbConfigDescriptor config_desc_;
441 }; 437 };
442 438
443 class MockUsbService : public UsbService { 439 class MockUsbService : public UsbService {
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 EXPECT_EQ(2, listener.invoked_); 795 EXPECT_EQ(2, listener.invoked_);
800 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); 796 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_);
801 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); 797 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
802 } 798 }
803 799
804 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { 800 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) {
805 MockCountListenerForCheckingTraits listener(adb_bridge_); 801 MockCountListenerForCheckingTraits listener(adb_bridge_);
806 adb_bridge_->AddDeviceCountListener(&listener); 802 adb_bridge_->AddDeviceCountListener(&listener);
807 runner_->Run(); 803 runner_->Run();
808 } 804 }
OLDNEW
« no previous file with comments | « no previous file | content/app/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698