OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/chromedriver/chrome/adb_impl.h" | 5 #include "chrome/test/chromedriver/chrome/adb_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 AdbClientSocket::AdbQuery(5037, command, | 67 AdbClientSocket::AdbQuery(5037, command, |
68 base::Bind(&ResponseBuffer::OnResponse, response_buffer)); | 68 base::Bind(&ResponseBuffer::OnResponse, response_buffer)); |
69 } | 69 } |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 | 72 |
73 AdbImpl::AdbImpl( | 73 AdbImpl::AdbImpl( |
74 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy, | 74 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy, |
75 Log* log) | 75 Log* log) |
76 : io_message_loop_proxy_(io_message_loop_proxy), log_(log) { | 76 : io_message_loop_proxy_(io_message_loop_proxy), log_(log) { |
77 CHECK(io_message_loop_proxy_); | 77 CHECK(io_message_loop_proxy_.get()); |
78 } | 78 } |
79 | 79 |
80 AdbImpl::~AdbImpl() {} | 80 AdbImpl::~AdbImpl() {} |
81 | 81 |
82 Status AdbImpl::GetDevices(std::vector<std::string>* devices) { | 82 Status AdbImpl::GetDevices(std::vector<std::string>* devices) { |
83 std::string response; | 83 std::string response; |
84 Status status = ExecuteCommand("host:devices", &response); | 84 Status status = ExecuteCommand("host:devices", &response); |
85 if (!status.IsOk()) | 85 if (!status.IsOk()) |
86 return status; | 86 return status; |
87 base::StringTokenizer lines(response, "\n"); | 87 base::StringTokenizer lines(response, "\n"); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 Status AdbImpl::ExecuteHostShellCommand( | 203 Status AdbImpl::ExecuteHostShellCommand( |
204 const std::string& device_serial, | 204 const std::string& device_serial, |
205 const std::string& shell_command, | 205 const std::string& shell_command, |
206 std::string* response) { | 206 std::string* response) { |
207 return ExecuteCommand( | 207 return ExecuteCommand( |
208 "host:transport:" + device_serial + "|shell:" + shell_command, | 208 "host:transport:" + device_serial + "|shell:" + shell_command, |
209 response); | 209 response); |
210 } | 210 } |
211 | 211 |
OLD | NEW |