marionette-client
Advanced tools
Comparing version 0.12.1 to 0.13.0
(function(module, ns) { | ||
var debug = function() {}; | ||
var debug = require('debug')('marionette:command-stream'); | ||
var Responder = ns.require('responder'); | ||
var wire = require('json-wire-protocol'); | ||
var isNode = typeof(window) === 'undefined'; | ||
var isXpc = !isNode && (typeof(window.xpcModule) !== 'undefined'); | ||
var wire; | ||
if (isNode) { | ||
debug = require('debug')('marionette:command-stream'); | ||
wire = require('json-wire-protocol'); | ||
} else { | ||
wire = window.jsonWireProtocol; | ||
} | ||
if (isXpc) { | ||
debug = window.xpcModule.require('debug')('marionette:command-stream'); | ||
} | ||
/** | ||
@@ -22,0 +8,0 @@ * Command stream accepts a socket or any event |
@@ -5,4 +5,19 @@ /** | ||
(function(module, ns) { | ||
/** | ||
* Default for tap's x offset. | ||
* | ||
* @type Number | ||
* @private | ||
*/ | ||
var TAP_DEFAULT_X = 0; | ||
/** | ||
* Default for tap's y offset. | ||
* | ||
* @type Number | ||
* @private | ||
*/ | ||
var TAP_DEFAULT_Y = 0; | ||
/** | ||
* Creates an element reference | ||
@@ -195,2 +210,20 @@ * based on an id and a client instance. | ||
/** | ||
* Taps an element at given x and y coordinates. | ||
* | ||
* @method tap | ||
* @param {Number} [x=0] offset for the tap. | ||
* @param {Number} [y=0] offset for the tap. | ||
* @param {Function} [callback] [Error err] | ||
*/ | ||
tap: function(x, y, callback) { | ||
var cmd = { | ||
type: 'singleTap', | ||
x: x || TAP_DEFAULT_X, | ||
y: y || TAP_DEFAULT_Y | ||
}; | ||
return this._sendCommand(cmd, 'value', callback); | ||
}, | ||
/** | ||
* Clears element. | ||
@@ -251,2 +284,24 @@ * | ||
return this._sendCommand(cmd, 'value', callback); | ||
}, | ||
/** | ||
* Returns the size of a given element. | ||
* | ||
* The returned size will be in the following format: | ||
* | ||
* // returned in callback or result of this call in the sync driver. | ||
* { | ||
* x: Number, | ||
* y: Number | ||
* } | ||
* | ||
* @method size | ||
* @param {Function} callback [Error err, Object size]. | ||
* @return {Object} self. | ||
*/ | ||
size: function displayed(callback) { | ||
var cmd = { | ||
type: 'getElementSize' | ||
}; | ||
return this._sendCommand(cmd, 'value', callback); | ||
} | ||
@@ -253,0 +308,0 @@ |
{ | ||
"name": "marionette-client", | ||
"version": "0.12.1", | ||
"version": "0.13.0", | ||
"main": "lib/marionette/index", | ||
"description": "Marionette Javascript Client", | ||
"author": "James Lal", | ||
"dependencies" : { | ||
"dependencies": { | ||
"debug": "~0.6", | ||
@@ -14,17 +13,15 @@ "json-wire-protocol": "~0.2.1", | ||
}, | ||
"scripts": { | ||
"test": "make ci REPORTER=dot" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.10", | ||
"expect.js": "0.1.2", | ||
"xpcwindow": "0.4.4", | ||
"yuidocjs": "~0.3", | ||
"test-agent": "~0.12", | ||
"marionette-host-environment": "~0.3.0", | ||
"node-static": "~0.6" | ||
"node-static": "~0.6", | ||
"marionette-js-runner": "~0.0.1", | ||
"mozilla-download": "~0.2", | ||
"chai": "~1.7.2" | ||
}, | ||
"license": "MIT", | ||
@@ -31,0 +28,0 @@ "engine": { |
@@ -6,3 +6,3 @@ # Marionette JS Client | ||
Designed to run on nodejs & xpcshell. | ||
Designed to run on [Node.js](http://nodejs.org). | ||
@@ -9,0 +9,0 @@ - [Api Docs](http://lightsofapollo.github.com/marionette_js_client/api-docs/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
85555
8
2828