mirror of
https://github.com/appium/appium.git
synced 2026-10-25 10:17:00 +08:00
stub out some functions used to get webviews going on android
This commit is contained in:
@@ -648,6 +648,11 @@ ADB.prototype.forwardPort = function (systemPort, devicePort, cb) {
|
||||
this.exec("forward tcp:" + systemPort + " tcp:" + devicePort, cb);
|
||||
};
|
||||
|
||||
ADB.prototype.forwardAbstractPort = function (systemPort, devicePort, cb) {
|
||||
this.debug("Forwarding system:" + systemPort + " to abstract device:" + devicePort);
|
||||
this.exec("forward tcp:" + systemPort + " localabstract:" + devicePort, cb);
|
||||
};
|
||||
|
||||
ADB.prototype.isDeviceConnected = function (cb) {
|
||||
this.getConnectedDevices(function (err, devices) {
|
||||
if (err) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
var logger = require('../../server/logger.js').get('appium')
|
||||
, _ = require('underscore')
|
||||
, deviceCommon = require('../common.js')
|
||||
, rd = require('../remote-debugger.js');
|
||||
|
||||
var getWebviews = function (cb) {
|
||||
var webviews = [];
|
||||
this.adb.shell("cat /proc/net/unix", function (err, out) {
|
||||
_.each(out.split("\n"), function (line) {
|
||||
if (line.indexOf("@webview_devtools_remote_") !== -1) {
|
||||
webviews.push(/@(webview_devtools_remote_.+)$/.exec(line)[1]);
|
||||
}
|
||||
});
|
||||
});
|
||||
return webviews;
|
||||
};
|
||||
|
||||
var setupPorts = function (localPort, abstractDevicePort, cb) {
|
||||
this.adb.forwardAbstractPort(localPort, abstractDevicePort, cb);
|
||||
};
|
||||
Reference in New Issue
Block a user