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

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

Issue 1784733002: Track USB device configuration state in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink_open_state
Patch Set: Rebased. Created 4 years, 9 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/renderer/usb/type_converters.cc » ('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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 device::USB_USAGE_DATA, 0); 414 device::USB_USAGE_DATA, 0);
415 config_desc_.interfaces.push_back(interface_desc); 415 config_desc_.interfaces.push_back(interface_desc);
416 } 416 }
417 417
418 void Open(const OpenCallback& callback) override { 418 void Open(const OpenCallback& callback) override {
419 base::ThreadTaskRunnerHandle::Get()->PostTask( 419 base::ThreadTaskRunnerHandle::Get()->PostTask(
420 FROM_HERE, base::Bind(callback, make_scoped_refptr( 420 FROM_HERE, base::Bind(callback, make_scoped_refptr(
421 new MockUsbDeviceHandle<T>(this)))); 421 new MockUsbDeviceHandle<T>(this))));
422 } 422 }
423 423
424 const UsbConfigDescriptor* GetActiveConfiguration() override { 424 const UsbConfigDescriptor* GetActiveConfiguration() const override {
425 return T::kConfigured ? &config_desc_ : nullptr; 425 return T::kConfigured ? &config_desc_ : nullptr;
426 } 426 }
427 427
428 std::set<int> claimed_interfaces_; 428 std::set<int> claimed_interfaces_;
429 429
430 protected: 430 protected:
431 virtual ~MockUsbDevice() {} 431 virtual ~MockUsbDevice() {}
432 432
433 private: 433 private:
434 UsbConfigDescriptor config_desc_; 434 UsbConfigDescriptor config_desc_;
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 EXPECT_EQ(2, listener.invoked_); 793 EXPECT_EQ(2, listener.invoked_);
794 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); 794 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_);
795 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); 795 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
796 } 796 }
797 797
798 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { 798 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) {
799 MockCountListenerForCheckingTraits listener(adb_bridge_); 799 MockCountListenerForCheckingTraits listener(adb_bridge_);
800 adb_bridge_->AddDeviceCountListener(&listener); 800 adb_bridge_->AddDeviceCountListener(&listener);
801 runner_->Run(); 801 runner_->Run();
802 } 802 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/usb/type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698