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 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "chrome/test/chromedriver/chrome/adb.h" | 13 #include "chrome/test/chromedriver/chrome/adb.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 } | 17 } |
18 | 18 |
19 class Status; | 19 class Status; |
20 | 20 |
21 class AdbImpl : public Adb { | 21 class AdbImpl : public Adb { |
22 public: | 22 public: |
23 explicit AdbImpl( | 23 explicit AdbImpl( |
24 const scoped_refptr<base::SingleThreadTaskRunner>& io_message_loop_proxy, | 24 const scoped_refptr<base::SingleThreadTaskRunner>& io_message_loop_proxy, |
25 int port); | 25 int port); |
26 virtual ~AdbImpl(); | 26 virtual ~AdbImpl(); |
27 | 27 |
28 // Overridden from Adb: | 28 // Overridden from Adb: |
29 virtual Status GetDevices(std::vector<std::string>* devices) OVERRIDE; | 29 virtual Status GetDevices(std::vector<std::string>* devices) override; |
30 virtual Status ForwardPort(const std::string& device_serial, | 30 virtual Status ForwardPort(const std::string& device_serial, |
31 int local_port, | 31 int local_port, |
32 const std::string& remote_abstract) OVERRIDE; | 32 const std::string& remote_abstract) override; |
33 virtual Status SetCommandLineFile(const std::string& device_serial, | 33 virtual Status SetCommandLineFile(const std::string& device_serial, |
34 const std::string& command_line_file, | 34 const std::string& command_line_file, |
35 const std::string& exec_name, | 35 const std::string& exec_name, |
36 const std::string& args) OVERRIDE; | 36 const std::string& args) override; |
37 virtual Status CheckAppInstalled(const std::string& device_serial, | 37 virtual Status CheckAppInstalled(const std::string& device_serial, |
38 const std::string& package) OVERRIDE; | 38 const std::string& package) override; |
39 virtual Status ClearAppData(const std::string& device_serial, | 39 virtual Status ClearAppData(const std::string& device_serial, |
40 const std::string& package) OVERRIDE; | 40 const std::string& package) override; |
41 virtual Status SetDebugApp(const std::string& device_serial, | 41 virtual Status SetDebugApp(const std::string& device_serial, |
42 const std::string& package) OVERRIDE; | 42 const std::string& package) override; |
43 virtual Status Launch(const std::string& device_serial, | 43 virtual Status Launch(const std::string& device_serial, |
44 const std::string& package, | 44 const std::string& package, |
45 const std::string& activity) OVERRIDE; | 45 const std::string& activity) override; |
46 virtual Status ForceStop(const std::string& device_serial, | 46 virtual Status ForceStop(const std::string& device_serial, |
47 const std::string& package) OVERRIDE; | 47 const std::string& package) override; |
48 virtual Status GetPidByName(const std::string& device_serial, | 48 virtual Status GetPidByName(const std::string& device_serial, |
49 const std::string& process_name, | 49 const std::string& process_name, |
50 int* pid) OVERRIDE; | 50 int* pid) override; |
51 | 51 |
52 private: | 52 private: |
53 Status ExecuteCommand(const std::string& command, | 53 Status ExecuteCommand(const std::string& command, |
54 std::string* response); | 54 std::string* response); |
55 Status ExecuteHostCommand(const std::string& device_serial, | 55 Status ExecuteHostCommand(const std::string& device_serial, |
56 const std::string& host_command, | 56 const std::string& host_command, |
57 std::string* response); | 57 std::string* response); |
58 Status ExecuteHostShellCommand(const std::string& device_serial, | 58 Status ExecuteHostShellCommand(const std::string& device_serial, |
59 const std::string& shell_command, | 59 const std::string& shell_command, |
60 std::string* response); | 60 std::string* response); |
61 | 61 |
62 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 62 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
63 | 63 |
64 int port_; | 64 int port_; |
65 }; | 65 }; |
66 | 66 |
67 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ | 67 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_ADB_IMPL_H_ |
OLD | NEW |