2015-03-20 00:12:58 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2017-03-06 20:39:42 +03:00
|
|
|
const {Constructor: CC, classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-04-15 03:50:29 +03:00
|
|
|
const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
|
|
|
.getService(Ci.mozIJSSubScriptLoader);
|
|
|
|
const ServerSocket = CC(
|
|
|
|
"@mozilla.org/network/server-socket;1",
|
|
|
|
"nsIServerSocket",
|
|
|
|
"initSpecialConnection");
|
2015-03-20 00:12:58 +03:00
|
|
|
|
|
|
|
Cu.import("resource://gre/modules/Log.jsm");
|
2016-01-19 01:05:30 +03:00
|
|
|
Cu.import("resource://gre/modules/Preferences.jsm");
|
2015-03-20 00:12:58 +03:00
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
2017-03-06 20:39:42 +03:00
|
|
|
Cu.import("resource://gre/modules/Task.jsm");
|
2017-04-15 03:50:29 +03:00
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-03-06 20:39:42 +03:00
|
|
|
Cu.import("chrome://marionette/content/assert.js");
|
2017-06-30 02:40:24 +03:00
|
|
|
const {GeckoDriver} = Cu.import("chrome://marionette/content/driver.js", {});
|
2017-06-28 21:01:49 +03:00
|
|
|
const {
|
|
|
|
error,
|
|
|
|
UnknownCommandError,
|
|
|
|
} = Cu.import("chrome://marionette/content/error.js", {});
|
2017-03-06 20:39:42 +03:00
|
|
|
Cu.import("chrome://marionette/content/message.js");
|
2017-06-30 02:40:24 +03:00
|
|
|
const {DebuggerTransport} =
|
|
|
|
Cu.import("chrome://marionette/content/transport.js", {});
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-04-15 03:50:29 +03:00
|
|
|
XPCOMUtils.defineLazyServiceGetter(
|
|
|
|
this, "env", "@mozilla.org/process/environment;1", "nsIEnvironment");
|
|
|
|
|
2015-03-20 00:12:58 +03:00
|
|
|
const logger = Log.repository.getLogger("Marionette");
|
|
|
|
|
2017-04-19 17:10:28 +03:00
|
|
|
const {KeepWhenOffline, LoopbackOnly} = Ci.nsIServerSocket;
|
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
this.EXPORTED_SYMBOLS = ["server"];
|
2017-07-26 15:11:53 +03:00
|
|
|
|
|
|
|
/** @namespace */
|
2017-03-06 20:09:07 +03:00
|
|
|
this.server = {};
|
2016-01-19 01:05:30 +03:00
|
|
|
|
2017-03-06 20:39:42 +03:00
|
|
|
const PROTOCOL_VERSION = 3;
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-04-15 03:50:29 +03:00
|
|
|
const ENV_ENABLED = "MOZ_MARIONETTE";
|
|
|
|
|
2017-03-08 00:02:05 +03:00
|
|
|
const PREF_CONTENT_LISTENER = "marionette.contentListener";
|
2017-04-24 12:28:57 +03:00
|
|
|
const PREF_PORT = "marionette.port";
|
2017-03-08 00:02:05 +03:00
|
|
|
const PREF_RECOMMENDED = "marionette.prefs.recommended";
|
|
|
|
|
2017-04-28 01:18:26 +03:00
|
|
|
const NOTIFY_RUNNING = "remote-active";
|
|
|
|
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
// Marionette sets preferences recommended for automation when it starts,
|
|
|
|
// unless |marionette.prefs.recommended| has been set to false.
|
|
|
|
// Where noted, some prefs should also be set in the profile passed to
|
|
|
|
// Marionette to prevent them from affecting startup, since some of these
|
|
|
|
// are checked before Marionette initialises.
|
|
|
|
const RECOMMENDED_PREFS = new Map([
|
|
|
|
|
|
|
|
// Disable automatic downloading of new releases.
|
|
|
|
//
|
|
|
|
// This should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["app.update.auto", false],
|
|
|
|
|
|
|
|
// Disable automatically upgrading Firefox.
|
|
|
|
//
|
|
|
|
// This should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["app.update.enabled", false],
|
|
|
|
|
|
|
|
// Increase the APZ content response timeout in tests to 1 minute.
|
|
|
|
// This is to accommodate the fact that test environments tends to be
|
|
|
|
// slower than production environments (with the b2g emulator being
|
|
|
|
// the slowest of them all), resulting in the production timeout value
|
|
|
|
// sometimes being exceeded and causing false-positive test failures.
|
|
|
|
//
|
|
|
|
// (bug 1176798, bug 1177018, bug 1210465)
|
|
|
|
["apz.content_response_timeout", 60000],
|
|
|
|
|
|
|
|
// Indicate that the download panel has been shown once so that
|
|
|
|
// whichever download test runs first doesn't show the popup
|
|
|
|
// inconsistently.
|
|
|
|
["browser.download.panel.shown", true],
|
|
|
|
|
|
|
|
// Do not show the EULA notification.
|
|
|
|
//
|
|
|
|
// This should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["browser.EULA.override", true],
|
|
|
|
|
|
|
|
// Turn off about:newtab and make use of about:blank instead for new
|
|
|
|
// opened tabs.
|
|
|
|
//
|
|
|
|
// This should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["browser.newtabpage.enabled", false],
|
|
|
|
|
|
|
|
// Assume the about:newtab page's intro panels have been shown to not
|
|
|
|
// depend on which test runs first and happens to open about:newtab
|
|
|
|
["browser.newtabpage.introShown", true],
|
|
|
|
|
|
|
|
// Never start the browser in offline mode
|
|
|
|
//
|
|
|
|
// This should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["browser.offline", false],
|
|
|
|
|
|
|
|
// Background thumbnails in particular cause grief, and disabling
|
|
|
|
// thumbnails in general cannot hurt
|
|
|
|
["browser.pagethumbnails.capturing_disabled", true],
|
|
|
|
|
|
|
|
// Disable safebrowsing components.
|
|
|
|
//
|
|
|
|
// These should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["browser.safebrowsing.blockedURIs.enabled", false],
|
|
|
|
["browser.safebrowsing.downloads.enabled", false],
|
|
|
|
["browser.safebrowsing.malware.enabled", false],
|
|
|
|
["browser.safebrowsing.phishing.enabled", false],
|
|
|
|
|
|
|
|
// Disable updates to search engines.
|
|
|
|
//
|
|
|
|
// Should be set in profile.
|
|
|
|
["browser.search.update", false],
|
|
|
|
|
|
|
|
// Do not restore the last open set of tabs if the browser has crashed
|
|
|
|
["browser.sessionstore.resume_from_crash", false],
|
|
|
|
|
|
|
|
// Don't check for the default web browser during startup.
|
|
|
|
//
|
|
|
|
// These should also be set in the profile prior to starting Firefox,
|
|
|
|
// as it is picked up at runtime.
|
|
|
|
["browser.shell.checkDefaultBrowser", false],
|
|
|
|
|
|
|
|
// Start with a blank page (about:blank)
|
|
|
|
["browser.startup.page", 0],
|
|
|
|
|
2017-03-28 21:50:33 +03:00
|
|
|
// Do not redirect user when a milstone upgrade of Firefox is detected
|
|
|
|
["browser.startup.homepage_override.mstone", "ignore"],
|
|
|
|
|
2017-04-11 21:47:31 +03:00
|
|
|
// Disable browser animations
|
|
|
|
["toolkit.cosmeticAnimations.enabled", false],
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
|
|
|
// Do not allow background tabs to be zombified, otherwise for tests
|
|
|
|
// that open additional tabs, the test harness tab itself might get
|
|
|
|
// unloaded
|
|
|
|
["browser.tabs.disableBackgroundZombification", false],
|
|
|
|
|
|
|
|
// Do not warn when closing all other open tabs
|
|
|
|
["browser.tabs.warnOnCloseOtherTabs", false],
|
|
|
|
|
|
|
|
// Do not warn when multiple tabs will be opened
|
|
|
|
["browser.tabs.warnOnOpen", false],
|
|
|
|
|
|
|
|
// Disable first run splash page on Windows 10
|
|
|
|
["browser.usedOnWindows10.introURL", ""],
|
|
|
|
|
|
|
|
// Disable the UI tour.
|
|
|
|
//
|
|
|
|
// Should be set in profile.
|
|
|
|
["browser.uitour.enabled", false],
|
|
|
|
|
|
|
|
// Do not show datareporting policy notifications which can
|
|
|
|
// interfere with tests
|
2017-06-30 02:40:24 +03:00
|
|
|
[
|
|
|
|
"datareporting.healthreport.about.reportUrl",
|
|
|
|
"http://%(server)s/dummy/abouthealthreport/",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"datareporting.healthreport.documentServerURI",
|
|
|
|
"http://%(server)s/dummy/healthreport/",
|
|
|
|
],
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
["datareporting.healthreport.logging.consoleEnabled", false],
|
|
|
|
["datareporting.healthreport.service.enabled", false],
|
|
|
|
["datareporting.healthreport.service.firstRun", false],
|
|
|
|
["datareporting.healthreport.uploadEnabled", false],
|
|
|
|
["datareporting.policy.dataSubmissionEnabled", false],
|
|
|
|
["datareporting.policy.dataSubmissionPolicyAccepted", false],
|
|
|
|
["datareporting.policy.dataSubmissionPolicyBypassNotification", true],
|
|
|
|
|
|
|
|
// Disable popup-blocker
|
|
|
|
["dom.disable_open_during_load", false],
|
|
|
|
|
|
|
|
// Disable the ProcessHangMonitor
|
|
|
|
["dom.ipc.reportProcessHangs", false],
|
|
|
|
|
|
|
|
// Disable slow script dialogues
|
|
|
|
["dom.max_chrome_script_run_time", 0],
|
|
|
|
["dom.max_script_run_time", 0],
|
|
|
|
|
|
|
|
// Only load extensions from the application and user profile
|
|
|
|
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
|
|
|
|
//
|
|
|
|
// Should be set in profile.
|
|
|
|
["extensions.autoDisableScopes", 0],
|
|
|
|
["extensions.enabledScopes", 5],
|
|
|
|
|
|
|
|
// Do not block add-ons for e10s
|
|
|
|
["extensions.e10sBlocksEnabling", false],
|
|
|
|
|
|
|
|
// Disable metadata caching for installed add-ons by default
|
|
|
|
["extensions.getAddons.cache.enabled", false],
|
|
|
|
|
|
|
|
// Disable intalling any distribution extensions or add-ons.
|
|
|
|
// Should be set in profile.
|
|
|
|
["extensions.installDistroAddons", false],
|
|
|
|
["extensions.showMismatchUI", false],
|
|
|
|
|
|
|
|
// Turn off extension updates so they do not bother tests
|
|
|
|
["extensions.update.enabled", false],
|
|
|
|
["extensions.update.notifyUser", false],
|
|
|
|
|
|
|
|
// Make sure opening about:addons will not hit the network
|
2017-06-30 02:40:24 +03:00
|
|
|
[
|
|
|
|
"extensions.webservice.discoverURL",
|
|
|
|
"http://%(server)s/dummy/discoveryURL",
|
|
|
|
],
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
|
|
|
// Allow the application to have focus even it runs in the background
|
|
|
|
["focusmanager.testmode", true],
|
|
|
|
|
|
|
|
// Disable useragent updates
|
|
|
|
["general.useragent.updates.enabled", false],
|
|
|
|
|
|
|
|
// Always use network provider for geolocation tests so we bypass the
|
|
|
|
// macOS dialog raised by the corelocation provider
|
|
|
|
["geo.provider.testing", true],
|
|
|
|
|
|
|
|
// Do not scan Wifi
|
|
|
|
["geo.wifi.scan", false],
|
|
|
|
|
|
|
|
// No hang monitor
|
|
|
|
["hangmonitor.timeout", 0],
|
|
|
|
|
|
|
|
// Show chrome errors and warnings in the error console
|
|
|
|
["javascript.options.showInConsole", true],
|
|
|
|
|
|
|
|
// Do not prompt for temporary redirects
|
|
|
|
["network.http.prompt-temp-redirect", false],
|
|
|
|
|
|
|
|
// Disable speculative connections so they are not reported as leaking
|
|
|
|
// when they are hanging around
|
|
|
|
["network.http.speculative-parallel-limit", 0],
|
|
|
|
|
|
|
|
// Do not automatically switch between offline and online
|
|
|
|
["network.manage-offline-status", false],
|
|
|
|
|
|
|
|
// Make sure SNTP requests do not hit the network
|
|
|
|
["network.sntp.pools", "%(server)s"],
|
|
|
|
|
|
|
|
// Local documents have access to all other local documents,
|
|
|
|
// including directory listings
|
|
|
|
["security.fileuri.strict_origin_policy", false],
|
|
|
|
|
|
|
|
// Tests do not wait for the notification button security delay
|
|
|
|
["security.notification_enable_delay", 0],
|
|
|
|
|
|
|
|
// Ensure blocklist updates do not hit the network
|
|
|
|
["services.settings.server", "http://%(server)s/dummy/blocklist/"],
|
|
|
|
|
|
|
|
// Do not automatically fill sign-in forms with known usernames and
|
|
|
|
// passwords
|
|
|
|
["signon.autofillForms", false],
|
|
|
|
|
|
|
|
// Disable password capture, so that tests that include forms are not
|
|
|
|
// influenced by the presence of the persistent doorhanger notification
|
|
|
|
["signon.rememberSignons", false],
|
|
|
|
|
|
|
|
// Disable first-run welcome page
|
|
|
|
["startup.homepage_welcome_url", "about:blank"],
|
|
|
|
["startup.homepage_welcome_url.additional", ""],
|
|
|
|
|
|
|
|
// Prevent starting into safe mode after application crashes
|
|
|
|
["toolkit.startup.max_resumed_crashes", -1],
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
2015-03-20 00:12:58 +03:00
|
|
|
/**
|
|
|
|
* Bootstraps Marionette and handles incoming client connections.
|
|
|
|
*
|
2017-03-06 20:39:42 +03:00
|
|
|
* Starting the Marionette server will open a TCP socket sporting the
|
|
|
|
* debugger transport interface on the provided |port|. For every new
|
|
|
|
* connection, a |server.TCPConnection| is created.
|
2015-03-20 00:12:58 +03:00
|
|
|
*/
|
2017-03-06 20:09:07 +03:00
|
|
|
server.TCPListener = class {
|
|
|
|
/**
|
|
|
|
* @param {number} port
|
|
|
|
* Port for server to listen to.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
constructor(port) {
|
2017-03-06 20:09:07 +03:00
|
|
|
this.port = port;
|
2017-04-24 12:28:57 +03:00
|
|
|
this.socket = null;
|
2017-03-06 20:39:42 +03:00
|
|
|
this.conns = new Set();
|
|
|
|
this.nextConnID = 0;
|
2017-03-06 20:09:07 +03:00
|
|
|
this.alive = false;
|
|
|
|
this._acceptConnections = false;
|
|
|
|
this.alteredPrefs = new Set();
|
|
|
|
}
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
/**
|
|
|
|
* Function produces a GeckoDriver.
|
|
|
|
*
|
2017-04-24 12:28:57 +03:00
|
|
|
* Determines application name to initialise the driver with.
|
2017-03-06 20:09:07 +03:00
|
|
|
*
|
|
|
|
* @return {GeckoDriver}
|
|
|
|
* A driver instance.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
driverFactory() {
|
2017-03-08 00:02:05 +03:00
|
|
|
Preferences.set(PREF_CONTENT_LISTENER, false);
|
2017-03-06 20:09:07 +03:00
|
|
|
return new GeckoDriver(Services.appinfo.name, this);
|
2016-10-17 14:19:19 +03:00
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
set acceptConnections(value) {
|
2017-03-06 20:09:07 +03:00
|
|
|
if (!value) {
|
|
|
|
logger.info("New connections will no longer be accepted");
|
|
|
|
} else {
|
|
|
|
logger.info("New connections are accepted again");
|
|
|
|
}
|
2016-10-17 14:19:19 +03:00
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
this._acceptConnections = value;
|
2015-03-20 00:12:58 +03:00
|
|
|
}
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
2017-04-24 12:28:57 +03:00
|
|
|
/**
|
|
|
|
* Bind this listener to |port| and start accepting incoming socket
|
|
|
|
* connections on |onSocketAccepted|.
|
|
|
|
*
|
|
|
|
* The marionette.port preference will be populated with the value
|
|
|
|
* of |this.port|.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
start() {
|
2017-03-06 20:09:07 +03:00
|
|
|
if (this.alive) {
|
|
|
|
return;
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
}
|
|
|
|
|
2017-04-28 01:18:26 +03:00
|
|
|
Services.obs.notifyObservers(this, NOTIFY_RUNNING, true);
|
|
|
|
|
2017-03-08 00:02:05 +03:00
|
|
|
if (Preferences.get(PREF_RECOMMENDED)) {
|
|
|
|
// set recommended prefs if they are not already user-defined
|
|
|
|
for (let [k, v] of RECOMMENDED_PREFS) {
|
|
|
|
if (!Preferences.isSet(k)) {
|
|
|
|
logger.debug(`Setting recommended pref ${k} to ${v}`);
|
|
|
|
Preferences.set(k, v);
|
|
|
|
this.alteredPrefs.add(k);
|
|
|
|
}
|
2017-03-06 20:09:07 +03:00
|
|
|
}
|
|
|
|
}
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
2017-04-19 17:10:28 +03:00
|
|
|
const flags = KeepWhenOffline | LoopbackOnly;
|
|
|
|
const backlog = 1;
|
2017-04-24 12:28:57 +03:00
|
|
|
this.socket = new ServerSocket(this.port, flags, backlog);
|
|
|
|
this.socket.asyncListen(this);
|
|
|
|
this.port = this.socket.port;
|
|
|
|
Preferences.set(PREF_PORT, this.port);
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
this.alive = true;
|
|
|
|
this._acceptConnections = true;
|
2017-04-15 03:50:29 +03:00
|
|
|
env.set(ENV_ENABLED, "1");
|
2015-03-20 00:12:58 +03:00
|
|
|
}
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
stop() {
|
2017-03-06 20:09:07 +03:00
|
|
|
if (!this.alive) {
|
|
|
|
return;
|
|
|
|
}
|
Bug 1344748 - Set recommended prefs when Marionette starts; r=automatedtester,maja_zf,whimboo
This makes the Marionette server itself set a long list of recommended
automation preferences when it starts up, and reset those it changed
when stopping.
Preferences used in automation are currently written to the Firefox
profile before Firefox starts, but after a closer examination of the
preferences, it is thought that many of them can be set at runtime.
There is a subset of preferences that are checked on startup and which
must be set in the profile. These are clearly called out in the comments.
We still set them at runtime, since we foresee a future where it will
be possible to attach an existing Firefox session to geckodriver, and
many of the prefs can also be checked at runtime during the course of
that automation session.
For example, if we would not set the "app.update.auto" preference in
such a runtime, opening the About dialogue would cause a forced update
of Firefox. This is not desirable when the browser is under Marionette
control. When the Marionette server is stopped, the altered preferences
are reset and the browser session's state is returned to its pre-existing
condition.
This change does not mean it is dangerous or wrong for consumers to write
their own preferences to the profile. Any preferences written to the
profile will take precedence over this set of recommended preferences.
If the recommended Marionette preference has a user-defined value (i.e. it
is written to the profile before starting up or has manually changed),
that user-set value is preferred.
The list of preferences in this file is the authorative reference of
recommended preferences for using Marionette in automation. They have
been gathered from geckoinstance.py and geckodriver.
MozReview-Commit-ID: INHSQRg2XjF
--HG--
extra : rebase_source : e1684133d287d2891feaa52ae4d267e8df4fa8e2
2017-03-06 19:47:38 +03:00
|
|
|
|
2017-04-24 12:28:57 +03:00
|
|
|
this._acceptConnections = false;
|
|
|
|
|
|
|
|
this.socket.close();
|
|
|
|
this.socket = null;
|
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
for (let k of this.alteredPrefs) {
|
|
|
|
logger.debug(`Resetting recommended pref ${k}`);
|
|
|
|
Preferences.reset(k);
|
|
|
|
}
|
|
|
|
this.alteredPrefs.clear();
|
2017-04-28 01:18:26 +03:00
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
Services.obs.notifyObservers(this, NOTIFY_RUNNING);
|
2017-04-28 01:18:26 +03:00
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
this.alive = false;
|
2016-10-17 14:19:19 +03:00
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
onSocketAccepted(serverSocket, clientSocket) {
|
2017-03-06 20:09:07 +03:00
|
|
|
if (!this._acceptConnections) {
|
|
|
|
logger.warn("New connections are currently not accepted");
|
|
|
|
return;
|
|
|
|
}
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-03-06 20:09:07 +03:00
|
|
|
let input = clientSocket.openInputStream(0, 0, 0);
|
|
|
|
let output = clientSocket.openOutputStream(0, 0, 0);
|
|
|
|
let transport = new DebuggerTransport(input, output);
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-03-06 20:39:42 +03:00
|
|
|
let conn = new server.TCPConnection(
|
|
|
|
this.nextConnID++, transport, this.driverFactory.bind(this));
|
|
|
|
conn.onclose = this.onConnectionClosed.bind(this);
|
|
|
|
this.conns.add(conn);
|
2015-03-20 00:12:58 +03:00
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
logger.debug(`Accepted connection ${conn.id} ` +
|
|
|
|
`from ${clientSocket.host}:${clientSocket.port}`);
|
2017-03-06 20:39:42 +03:00
|
|
|
conn.sayHello();
|
2017-03-06 20:09:07 +03:00
|
|
|
transport.ready();
|
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
onConnectionClosed(conn) {
|
2017-03-06 20:39:42 +03:00
|
|
|
logger.debug(`Closed connection ${conn.id}`);
|
|
|
|
this.conns.delete(conn);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Marionette client connection.
|
|
|
|
*
|
|
|
|
* Dispatches packets received to their correct service destinations
|
|
|
|
* and sends back the service endpoint's return values.
|
|
|
|
*
|
|
|
|
* @param {number} connID
|
|
|
|
* Unique identifier of the connection this dispatcher should handle.
|
|
|
|
* @param {DebuggerTransport} transport
|
|
|
|
* Debugger transport connection to the client.
|
|
|
|
* @param {function(): GeckoDriver} driverFactory
|
|
|
|
* Factory function that produces a |GeckoDriver|.
|
|
|
|
*/
|
|
|
|
server.TCPConnection = class {
|
2017-06-30 02:40:24 +03:00
|
|
|
constructor(connID, transport, driverFactory) {
|
2017-03-06 20:39:42 +03:00
|
|
|
this.id = connID;
|
|
|
|
this.conn = transport;
|
|
|
|
|
|
|
|
// transport hooks are TCPConnection#onPacket
|
|
|
|
// and TCPConnection#onClosed
|
|
|
|
this.conn.hooks = this;
|
|
|
|
|
|
|
|
// callback for when connection is closed
|
|
|
|
this.onclose = null;
|
|
|
|
|
|
|
|
// last received/sent message ID
|
|
|
|
this.lastID = 0;
|
|
|
|
|
|
|
|
this.driver = driverFactory();
|
|
|
|
|
|
|
|
// lookup of commands sent by server to client by message ID
|
|
|
|
this.commands_ = new Map();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Debugger transport callback that cleans up
|
|
|
|
* after a connection is closed.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
onClosed(reason) {
|
2017-03-06 20:39:42 +03:00
|
|
|
this.driver.deleteSession();
|
|
|
|
if (this.onclose) {
|
|
|
|
this.onclose(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback that receives data packets from the client.
|
|
|
|
*
|
|
|
|
* If the message is a Response, we look up the command previously
|
|
|
|
* issued to the client and run its callback, if any. In case of
|
|
|
|
* a Command, the corresponding is executed.
|
|
|
|
*
|
|
|
|
* @param {Array.<number, number, ?, ?>} data
|
|
|
|
* A four element array where the elements, in sequence, signifies
|
|
|
|
* message type, message ID, method name or error, and parameters
|
|
|
|
* or result.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
onPacket(data) {
|
2017-02-09 21:29:25 +03:00
|
|
|
// unable to determine how to respond
|
|
|
|
if (!Array.isArray(data)) {
|
|
|
|
let e = new TypeError(
|
|
|
|
"Unable to unmarshal packet data: " + JSON.stringify(data));
|
|
|
|
error.report(e);
|
|
|
|
return;
|
|
|
|
}
|
2017-03-06 20:39:42 +03:00
|
|
|
|
2017-02-09 21:29:25 +03:00
|
|
|
// return immediately with any error trying to unmarshal message
|
|
|
|
let msg;
|
|
|
|
try {
|
|
|
|
msg = Message.fromMsg(data);
|
|
|
|
msg.origin = MessageOrigin.Client;
|
|
|
|
this.log_(msg);
|
|
|
|
} catch (e) {
|
|
|
|
let resp = this.createResponse(data[1]);
|
|
|
|
resp.sendError(e);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// look up previous command we received a response for
|
2017-03-06 20:39:42 +03:00
|
|
|
if (msg instanceof Response) {
|
|
|
|
let cmd = this.commands_.get(msg.id);
|
|
|
|
this.commands_.delete(msg.id);
|
|
|
|
cmd.onresponse(msg);
|
2017-02-09 21:29:25 +03:00
|
|
|
|
|
|
|
// execute new command
|
2017-03-06 20:39:42 +03:00
|
|
|
} else if (msg instanceof Command) {
|
|
|
|
this.lastID = msg.id;
|
|
|
|
this.execute(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Executes a WebDriver command and sends back a response when it has
|
|
|
|
* finished executing.
|
|
|
|
*
|
|
|
|
* Commands implemented in GeckoDriver and registered in its
|
|
|
|
* {@code GeckoDriver.commands} attribute. The return values from
|
|
|
|
* commands are expected to be Promises. If the resolved value of said
|
|
|
|
* promise is not an object, the response body will be wrapped in
|
|
|
|
* an object under a "value" field.
|
|
|
|
*
|
|
|
|
* If the command implementation sends the response itself by calling
|
|
|
|
* {@code resp.send()}, the response is guaranteed to not be sent twice.
|
|
|
|
*
|
|
|
|
* Errors thrown in commands are marshaled and sent back, and if they
|
|
|
|
* are not WebDriverError instances, they are additionally propagated
|
|
|
|
* and reported to {@code Components.utils.reportError}.
|
|
|
|
*
|
|
|
|
* @param {Command} cmd
|
|
|
|
* The requested command to execute.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
execute(cmd) {
|
2017-02-09 21:29:25 +03:00
|
|
|
let resp = this.createResponse(cmd.id);
|
2017-03-06 20:39:42 +03:00
|
|
|
let sendResponse = () => resp.sendConditionally(resp => !resp.sent);
|
|
|
|
let sendError = resp.sendError.bind(resp);
|
|
|
|
|
2017-02-09 21:29:25 +03:00
|
|
|
let req = Task.spawn(function* () {
|
2017-03-06 20:39:42 +03:00
|
|
|
let fn = this.driver.commands[cmd.name];
|
|
|
|
if (typeof fn == "undefined") {
|
|
|
|
throw new UnknownCommandError(cmd.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmd.name !== "newSession") {
|
|
|
|
assert.session(this.driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
let rv = yield fn.bind(this.driver)(cmd, resp);
|
|
|
|
|
|
|
|
if (typeof rv != "undefined") {
|
|
|
|
if (typeof rv != "object") {
|
|
|
|
resp.body = {value: rv};
|
|
|
|
} else {
|
|
|
|
resp.body = rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
req.then(sendResponse, sendError).catch(error.report);
|
|
|
|
}
|
|
|
|
|
2017-02-09 21:29:25 +03:00
|
|
|
/**
|
|
|
|
* Fail-safe creation of a new instance of |message.Response|.
|
|
|
|
*
|
2017-07-26 15:11:53 +03:00
|
|
|
* @param {number} msgID
|
2017-02-09 21:29:25 +03:00
|
|
|
* Message ID to respond to. If it is not a number, -1 is used.
|
|
|
|
*
|
|
|
|
* @return {message.Response}
|
|
|
|
* Response to the message with |msgID|.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
createResponse(msgID) {
|
2017-02-09 21:29:25 +03:00
|
|
|
if (typeof msgID != "number") {
|
|
|
|
msgID = -1;
|
|
|
|
}
|
|
|
|
return new Response(msgID, this.send.bind(this));
|
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
sendError(err, cmdID) {
|
2017-03-06 20:39:42 +03:00
|
|
|
let resp = new Response(cmdID, this.send.bind(this));
|
|
|
|
resp.sendError(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When a client connects we send across a JSON Object defining the
|
|
|
|
* protocol level.
|
|
|
|
*
|
|
|
|
* This is the only message sent by Marionette that does not follow
|
|
|
|
* the regular message format.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
sayHello() {
|
2017-03-06 20:39:42 +03:00
|
|
|
let whatHo = {
|
|
|
|
applicationType: "gecko",
|
|
|
|
marionetteProtocol: PROTOCOL_VERSION,
|
|
|
|
};
|
|
|
|
this.sendRaw(whatHo);
|
2017-06-30 02:40:24 +03:00
|
|
|
}
|
2017-03-06 20:39:42 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Delegates message to client based on the provided {@code cmdID}.
|
|
|
|
* The message is sent over the debugger transport socket.
|
|
|
|
*
|
|
|
|
* The command ID is a unique identifier assigned to the client's request
|
|
|
|
* that is used to distinguish the asynchronous responses.
|
|
|
|
*
|
|
|
|
* Whilst responses to commands are synchronous and must be sent in the
|
|
|
|
* correct order.
|
|
|
|
*
|
2017-07-26 15:11:53 +03:00
|
|
|
* @param {Message} msg
|
2017-03-06 20:39:42 +03:00
|
|
|
* The command or response to send.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
send(msg) {
|
2017-03-06 20:39:42 +03:00
|
|
|
msg.origin = MessageOrigin.Server;
|
|
|
|
if (msg instanceof Command) {
|
|
|
|
this.commands_.set(msg.id, msg);
|
|
|
|
this.sendToEmulator(msg);
|
|
|
|
} else if (msg instanceof Response) {
|
|
|
|
this.sendToClient(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Low-level methods:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send given response to the client over the debugger transport socket.
|
|
|
|
*
|
|
|
|
* @param {Response} resp
|
|
|
|
* The response to send back to the client.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
sendToClient(resp) {
|
2017-03-06 20:39:42 +03:00
|
|
|
this.driver.responseCompleted();
|
|
|
|
this.sendMessage(resp);
|
2017-06-30 02:40:24 +03:00
|
|
|
}
|
2017-03-06 20:39:42 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Marshal message to the Marionette message format and send it.
|
|
|
|
*
|
2017-07-26 15:11:53 +03:00
|
|
|
* @param {Message} msg
|
2017-03-06 20:39:42 +03:00
|
|
|
* The message to send.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
sendMessage(msg) {
|
2017-03-06 20:39:42 +03:00
|
|
|
this.log_(msg);
|
|
|
|
let payload = msg.toMsg();
|
|
|
|
this.sendRaw(payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send the given payload over the debugger transport socket to the
|
|
|
|
* connected client.
|
|
|
|
*
|
2017-07-26 15:11:53 +03:00
|
|
|
* @param {Object.<string, ?>} payload
|
2017-03-06 20:39:42 +03:00
|
|
|
* The payload to ship.
|
|
|
|
*/
|
2017-06-30 02:40:24 +03:00
|
|
|
sendRaw(payload) {
|
2017-03-06 20:39:42 +03:00
|
|
|
this.conn.send(payload);
|
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
log_(msg) {
|
2017-03-06 20:39:42 +03:00
|
|
|
let a = (msg.origin == MessageOrigin.Client ? " -> " : " <- ");
|
|
|
|
let s = JSON.stringify(msg.toMsg());
|
|
|
|
logger.trace(this.id + a + s);
|
|
|
|
}
|
|
|
|
|
2017-06-30 02:40:24 +03:00
|
|
|
toString() {
|
2017-03-06 20:39:42 +03:00
|
|
|
return `[object server.TCPConnection ${this.id}]`;
|
2017-03-06 20:09:07 +03:00
|
|
|
}
|
2015-03-20 00:12:58 +03:00
|
|
|
};
|