OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/device_manager.h" | 5 #include "chrome/test/chromedriver/chrome/device_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (package.compare("org.chromium.content_shell_apk") == 0) { | 51 if (package.compare("org.chromium.content_shell_apk") == 0) { |
52 known_activity = ".ContentShellActivity"; | 52 known_activity = ".ContentShellActivity"; |
53 device_socket = "content_shell_devtools_remote"; | 53 device_socket = "content_shell_devtools_remote"; |
54 command_line_file = "/data/local/tmp/content-shell-command-line"; | 54 command_line_file = "/data/local/tmp/content-shell-command-line"; |
55 exec_name = "content_shell"; | 55 exec_name = "content_shell"; |
56 } else if (package.compare("org.chromium.chrome.testshell") == 0) { | 56 } else if (package.compare("org.chromium.chrome.testshell") == 0) { |
57 known_activity = ".ChromiumTestShellActivity"; | 57 known_activity = ".ChromiumTestShellActivity"; |
58 device_socket = "chromium_testshell_devtools_remote"; | 58 device_socket = "chromium_testshell_devtools_remote"; |
59 command_line_file = "/data/local/tmp/chromium-testshell-command-line"; | 59 command_line_file = "/data/local/tmp/chromium-testshell-command-line"; |
60 exec_name = "chromium_testshell"; | 60 exec_name = "chromium_testshell"; |
61 } else if (package.find("chrome") != std::string::npos) { | 61 } else if (package.find("chrome") != std::string::npos && |
| 62 package.find("webview") == std::string::npos) { |
62 known_activity = "com.google.android.apps.chrome.Main"; | 63 known_activity = "com.google.android.apps.chrome.Main"; |
63 device_socket = "chrome_devtools_remote"; | 64 device_socket = "chrome_devtools_remote"; |
64 command_line_file = "/data/local/chrome-command-line"; | 65 command_line_file = "/data/local/chrome-command-line"; |
65 exec_name = "chrome"; | 66 exec_name = "chrome"; |
66 } | 67 } |
67 | 68 |
68 if (!known_activity.empty()) { | 69 if (!known_activity.empty()) { |
69 if (!activity.empty() || !process.empty()) | 70 if (!activity.empty() || !process.empty()) |
70 return Status(kUnknownError, "known package " + package + | 71 return Status(kUnknownError, "known package " + package + |
71 " does not accept activity/process"); | 72 " does not accept activity/process"); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return new Device(device_serial, adb_, | 176 return new Device(device_serial, adb_, |
176 base::Bind(&DeviceManager::ReleaseDevice, base::Unretained(this), | 177 base::Bind(&DeviceManager::ReleaseDevice, base::Unretained(this), |
177 device_serial)); | 178 device_serial)); |
178 } | 179 } |
179 | 180 |
180 bool DeviceManager::IsDeviceLocked(const std::string& device_serial) { | 181 bool DeviceManager::IsDeviceLocked(const std::string& device_serial) { |
181 return std::find(active_devices_.begin(), active_devices_.end(), | 182 return std::find(active_devices_.begin(), active_devices_.end(), |
182 device_serial) != active_devices_.end(); | 183 device_serial) != active_devices_.end(); |
183 } | 184 } |
184 | 185 |
OLD | NEW |