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

Side by Side Diff: chrome/browser/devtools/device/adb/adb_client_socket_browsertest.cc

Issue 287643002: DevTools: Partially redesigned DevToolsAndroidBridge and AndroidDeviceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved Device::OpenSocket callback to HandlerThread Created 6 years, 6 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 | chrome/browser/devtools/device/adb/adb_device_info_query.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 "chrome/browser/devtools/device/adb/adb_device_provider.h" 5 #include "chrome/browser/devtools/device/adb/adb_device_provider.h"
6 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" 6 #include "chrome/browser/devtools/device/adb/mock_adb_server.h"
7 #include "chrome/browser/devtools/device/devtools_android_bridge.h" 7 #include "chrome/browser/devtools/device/devtools_android_bridge.h"
8 #include "chrome/browser/devtools/devtools_target_impl.h" 8 #include "chrome/browser/devtools/devtools_target_impl.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 16 matching lines...) Expand all
27 public DevToolsAndroidBridge::DeviceListListener { 27 public DevToolsAndroidBridge::DeviceListListener {
28 28
29 public: 29 public:
30 void StartTest() { 30 void StartTest() {
31 Profile* profile = browser()->profile(); 31 Profile* profile = browser()->profile();
32 android_bridge_ = DevToolsAndroidBridge::Factory::GetForProfile(profile); 32 android_bridge_ = DevToolsAndroidBridge::Factory::GetForProfile(profile);
33 AndroidDeviceManager::DeviceProviders device_providers; 33 AndroidDeviceManager::DeviceProviders device_providers;
34 device_providers.push_back(new AdbDeviceProvider()); 34 device_providers.push_back(new AdbDeviceProvider());
35 android_bridge_->set_device_providers_for_test(device_providers); 35 android_bridge_->set_device_providers_for_test(device_providers);
36 android_bridge_->AddDeviceListListener(this); 36 android_bridge_->AddDeviceListListener(this);
37 content::RunMessageLoop();
37 } 38 }
38 39
39 virtual void DeviceListChanged( 40 virtual void DeviceListChanged(
40 const DevToolsAndroidBridge::RemoteDevices& devices) OVERRIDE { 41 const DevToolsAndroidBridge::RemoteDevices& devices) OVERRIDE {
41 devices_ = devices; 42 devices_ = devices;
42 android_bridge_->RemoveDeviceListListener(this); 43 android_bridge_->RemoveDeviceListListener(this);
43 base::MessageLoop::current()->Quit(); 44 base::MessageLoop::current()->Quit();
44 } 45 }
45 46
46 void CheckDevices() { 47 void CheckDevices() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 119 }
119 120
120 private: 121 private:
121 scoped_refptr<DevToolsAndroidBridge> android_bridge_; 122 scoped_refptr<DevToolsAndroidBridge> android_bridge_;
122 DevToolsAndroidBridge::RemoteDevices devices_; 123 DevToolsAndroidBridge::RemoteDevices devices_;
123 }; 124 };
124 125
125 IN_PROC_BROWSER_TEST_F(AdbClientSocketTest, TestAdbClientSocket) { 126 IN_PROC_BROWSER_TEST_F(AdbClientSocketTest, TestAdbClientSocket) {
126 StartMockAdbServer(); 127 StartMockAdbServer();
127 StartTest(); 128 StartTest();
128 content::RunMessageLoop();
129 CheckDevices(); 129 CheckDevices();
130 StopMockAdbServer(); 130 StopMockAdbServer();
131 } 131 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/device/adb/adb_device_info_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698