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

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

Issue 861593003: [DevTools] Fix in AndroidBreakingUsbTest.TestDeviceBreaking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | 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 <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/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" 9 #include "chrome/browser/devtools/device/adb/mock_adb_server.h"
10 #include "chrome/browser/devtools/device/devtools_android_bridge.h" 10 #include "chrome/browser/devtools/device/devtools_android_bridge.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 622
623 void DeviceListChanged( 623 void DeviceListChanged(
624 const DevToolsAndroidBridge::RemoteDevices& devices) override { 624 const DevToolsAndroidBridge::RemoteDevices& devices) override {
625 if (devices.size() > 0) { 625 if (devices.size() > 0) {
626 for (const auto& device : devices) { 626 for (const auto& device : devices) {
627 if (device->is_connected()) { 627 if (device->is_connected()) {
628 ASSERT_EQ(kDeviceModel, device->model()); 628 ASSERT_EQ(kDeviceModel, device->model());
629 ASSERT_EQ(kDeviceSerial, device->serial()); 629 ASSERT_EQ(kDeviceSerial, device->serial());
630 adb_bridge_->RemoveDeviceListListener(this); 630 adb_bridge_->RemoveDeviceListListener(this);
631 callback_.Run(); 631 callback_.Run();
632 break;
632 } 633 }
633 } 634 }
634 } 635 }
635 } 636 }
636 637
637 DevToolsAndroidBridge* adb_bridge_; 638 DevToolsAndroidBridge* adb_bridge_;
638 base::Closure callback_; 639 base::Closure callback_;
639 }; 640 };
640 641
641 class MockCountListener : public DevToolsAndroidBridge::DeviceCountListener { 642 class MockCountListener : public DevToolsAndroidBridge::DeviceCountListener {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 runner_->Run(); 823 runner_->Run();
823 EXPECT_EQ(2, listener.invoked_); 824 EXPECT_EQ(2, listener.invoked_);
824 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_); 825 EXPECT_EQ(listener.invoked_ - 1, scheduler_invoked_);
825 } 826 }
826 827
827 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) { 828 IN_PROC_BROWSER_TEST_F(AndroidUsbTraitsTest, TestDeviceCounting) {
828 MockCountListenerForCheckingTraits listener(adb_bridge_); 829 MockCountListenerForCheckingTraits listener(adb_bridge_);
829 adb_bridge_->AddDeviceCountListener(&listener); 830 adb_bridge_->AddDeviceCountListener(&listener);
830 runner_->Run(); 831 runner_->Run();
831 } 832 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698