Commit Graph
65 Commits
Author SHA1 Message Date
Julian Descottes 073cdf0137 Bug 1492700 - Migrate AdbRuntime to a class;r=daisuke
Depends on D12766

Differential Revision: https://phabricator.services.mozilla.com/D12767
2018-11-27 12:53:26 +00:00
Julian Descottes 47dfd8f2ba Bug 1492700 - Extract AdbRuntime out of adb-scanner.js;r=daisuke
Depends on D12765

Differential Revision: https://phabricator.services.mozilla.com/D12766
2018-11-27 12:52:00 +00:00
Julian Descottes 18c0feb7f4 Bug 1492700 - Merge Runtime and FirefoxForAndroidRuntime into AdbRuntime;r=daisuke
Depends on D12764

Differential Revision: https://phabricator.services.mozilla.com/D12765
2018-11-27 12:51:37 +00:00
Julian Descottes d529e6b5d0 Bug 1492700 - Fold FirefoxOnAndroidRuntime.detect in scanner.detectRuntimes;r=daisuke
Depends on D12763

Differential Revision: https://phabricator.services.mozilla.com/D12764
2018-11-27 12:51:14 +00:00
Julian Descottes ffa9050a80 Bug 1492700 - Stop exposing shell() on adb-device because it only forwards to ADB;r=daisuke
Depends on D12762

Differential Revision: https://phabricator.services.mozilla.com/D12763
2018-11-27 12:50:57 +00:00
Julian Descottes 2e9c9a300f Bug 1492700 - adb-device.js should export AdbDevice and not Device;r=daisuke
Depends on D12761

Differential Revision: https://phabricator.services.mozilla.com/D12762
2018-11-27 12:50:45 +00:00
Julian Descottes fb53831f3c Bug 1492700 - Convert Devices.jsm to adb-devices-registry module;r=daisuke
Depends on D12760

Differential Revision: https://phabricator.services.mozilla.com/D12761
2018-11-27 12:50:12 +00:00
Julian Descottes 2ec2804e7a Bug 1492700 - Move Devices.jsm to devtools/shared/adb folder;r=daisuke
Depends on D12759

Differential Revision: https://phabricator.services.mozilla.com/D12760
2018-11-27 12:49:49 +00:00
Julian Descottes 366719d337 Bug 1492700 - Stop sending adb-addon updates from Devices.jsm;r=daisuke
Depends on D12758

Differential Revision: https://phabricator.services.mozilla.com/D12759
2018-11-27 12:49:11 +00:00
Julian Descottes b054cdfd03 Bug 1492700 - Fix ADB stop() in case ADB start() was called several times;r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D12758
2018-11-27 12:48:48 +00:00
Julian Descottes 2848b0a6f8 Bug 1507071 - Explicitly uninstall valence and adbhelper when starting aboutdebugging and webide;r=ochameau
Depends on D11862

Differential Revision: https://phabricator.services.mozilla.com/D11890
2018-11-14 15:33:01 +00:00
Julian Descottes 5c2f850fda Bug 1507071 - Uninstall valence when starting adb-addon module;r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D11862
2018-11-14 15:27:57 +00:00
Julian Descottes a0c9032217 Bug 1490629 - Update adb-addon install() to make source parameter mandatory;r=daisuke
Depends on D11166

Differential Revision: https://phabricator.services.mozilla.com/D11179
2018-11-08 07:29:11 +00:00
Mark Banner 3d6aaad3f5 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389
2018-10-19 12:55:39 +00:00
Julian Descottes 755a26a5c2 Bug 1494549 - Add a mochitest test for status message;r=ladybenko
Depends on D8334.
In this changeset we also change the way we are reading the preferences
in adb-addon.js to avoid caching the value of the preference the first
time the module is loaded.

This allows the module to follow updates of said preferences without
having to restart Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D8335
2018-10-17 11:10:33 +00:00
Margareta Eliza Balazs e3c9edad06 Backed out 3 changesets (bug 1494549) for multiple failures e.g.: devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_status.js CLOSED TREE
Backed out changeset 5729da1055e8 (bug 1494549)
Backed out changeset 7c62247314d7 (bug 1494549)
Backed out changeset bff7126ddd3f (bug 1494549)
2018-10-17 11:52:14 +03:00
Julian Descottes 945a62dd6f Bug 1494549 - Add a mochitest test for status message;r=ladybenko
Depends on D8334.
In this changeset we also change the way we are reading the preferences
in adb-addon.js to avoid caching the value of the preference the first
time the module is loaded.

This allows the module to follow updates of said preferences without
having to restart Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D8335
2018-10-17 07:20:08 +00:00
Belén Albeza d1850f87d4 Bug 1494543 - Part 2: Add model + short runtime name to the sidebar item. r=jdescottes,daisuke
Added new getters to the ADB scanner so our runtime objects have now the information we need.

Note that the UX of the devices in this patch doesn't still match what we had in the mockups (icons don't match, and we also need a circle with a tick), but since we have another bug to handle the CSS in the Sidebar, we can always adapt it there. The information needed to display what is shown in the mockups should be passed in this patch –if I miss anything, give me a shout!

Differential Revision: https://phabricator.services.mozilla.com/D7705
2018-10-16 11:57:45 +00:00
Cosmin Sabou 7a8566ed03 Backed out 3 changesets (bug 1494549) for OSX devtools failures. CLOSED TREE
Backed out changeset e9abf60db23b (bug 1494549)
Backed out changeset 3e89e661031c (bug 1494549)
Backed out changeset 0d7e2a4ad360 (bug 1494549)
2018-10-16 12:34:38 +03:00
Julian Descottes d70fc55dca Bug 1494549 - Add a mochitest test for status message;r=ladybenko
Depends on D8334.
In this changeset we also change the way we are reading the preferences
in adb-addon.js to avoid caching the value of the preference the first
time the module is loaded.

This allows the module to follow updates of said preferences without
having to restart Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D8335
2018-10-12 07:20:22 +00:00
Dorel Luca 65062a54b4 Backed out 2 changesets (bug 1494543) for causing Devtools failures in browser/base/content/test/static/browser_parsable_css.js. CLOSED TREE
Backed out changeset 744747bb295c (bug 1494543)
Backed out changeset 5a54f333b855 (bug 1494543)
2018-10-15 12:14:17 +03:00
Belén Albeza 131a35bec7 Bug 1494543 - Part 2: Add model + short runtime name to the sidebar item. r=jdescottes,daisuke
Added new getters to the ADB scanner so our runtime objects have now the information we need.

Note that the UX of the devices in this patch doesn't still match what we had in the mockups (icons don't match, and we also need a circle with a tick), but since we have another bug to handle the CSS in the Sidebar, we can always adapt it there. The information needed to display what is shown in the mockups should be passed in this patch –if I miss anything, give me a shout!

Differential Revision: https://phabricator.services.mozilla.com/D7705
2018-10-11 12:01:59 +00:00
Julian Descottes fbc7b9c05b Bug 1493104 - Add unit test for AddonAwareADBScanner;r=ladybenko,daisuke 2018-10-05 15:16:39 +02:00
Julian Descottes 57995f8c50 Bug 1493104 - Add ADBScanner decorator to listen to addon status udpates;r=ladybenko,daisuke 2018-10-05 13:51:18 +02:00
Julian Descottes 7f30313e4d Bug 1493104 - Convert ADBScanner from a singleton to a class;r=ladybenko,daisuke 2018-10-05 11:17:22 +02:00
Julian Descottes 07d7b56300 Bug 1496741 - Cleanup adb-addon.js module;r=ladybenko 2018-10-02 11:25:03 +02:00
Julian Descottes 037f0f9145 Bug 1494615 - Stop update Devices.jsm from adb-addon module;r=ladybenko
Depends on D7405. The adb-addon module fires events whenever the
addon state changes, so Devices.jsm should be able to simply reuse this
module to update its internal state, rather than having adb-addon set
something on Devices.jsm directly.

On a sidenote, we really should not propagate the adb status via Devices.jsm
but since WebIDE relies on this, I decided to keep the code as is for now.
We will remove it from Devices.jsm when WebIDE is removed.

Differential Revision: https://phabricator.services.mozilla.com/D7406
2018-10-04 18:45:22 +00:00
Julian Descottes 3d62057beb Bug 1494615 - Accept source parameter in adb-addon install();r=ladybenko
Depends on D7404. The install method should not hardcode "webide"
for the addon manager telemetry info

Differential Revision: https://phabricator.services.mozilla.com/D7405
2018-10-04 18:43:29 +00:00
Julian Descottes fd905a6b37 Bug 1494615 - Update adb-addon module to expose a singleton;r=ladybenko
Depends on D7403
The getADBAddon/forgetADBAddon is not removing listeners or doing
anything useful since the next call to getADBADdon will just recreate an
instance of ADBAddon. We can expose a singleton and use lazy requires to
achieve the same effect

Differential Revision: https://phabricator.services.mozilla.com/D7404
2018-10-04 18:40:38 +00:00
Julian Descottes d680a11370 Bug 1494615 - Move ADBAddon module to devtools/shared/adb;r=ladybenko
Depends on D7402. Moving the module to a shared older. Following
patches will cleanup the implementation to remove WebIDE couplings.

Differential Revision: https://phabricator.services.mozilla.com/D7403
2018-10-03 13:34:40 +00:00
Daisuke Akatsuka d0edff74e0 Bug 1494169 - Part 2: Connect to USB device. r=jdescottes
Depends on D6880

Differential Revision: https://phabricator.services.mozilla.com/D6881
2018-09-28 04:27:44 +00:00
Julian Descottes 354f9cb8f4 Bug 1491315 - Use new ADB extension in WebIDE;r=hiro 2018-09-14 15:59:24 +02:00
Hiroyuki Ikezoe 8e9e8d2b83 Bug 1483730 - Return null from getFileForAdb if the adb file doesn't exit. r=jdescottes
Summary: Depends on D3463

Reviewers: jdescottes

Reviewed By: jdescottes

Bug #: 1483730

Differential Revision: https://phabricator.services.mozilla.com/D3464
2018-08-17 06:58:42 +09:00
Hiroyuki Ikezoe 6b208d6d76 Bug 1483730 - Call nsIFile.exists method. r=jdescottes
Reviewers: jdescottes

Reviewed By: jdescottes

Bug #: 1483730

Differential Revision: https://phabricator.services.mozilla.com/D3463
2018-08-17 06:56:52 +09:00
Hiroyuki Ikezoe ae5f46b35d Bug 1481699 - Merge two if statements for 'start-server' into a single one. r=jdescottes
And fix some log messages.
2018-08-13 06:12:55 +09:00
Hiroyuki Ikezoe 634d64ba2b Bug 1481699 - Send host:kill command through TCP socket instead of spawning a new adb process with 'kill-server'. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D3170
2018-08-13 06:12:55 +09:00
Hiroyuki Ikezoe c2c68b5f08 Bug 1481699 - Do not process any further data after we started shutting down the ADB server. r=jdescottes
In the genuine adb binary, when it received 'host:kill' command, it exits the
server process soon [1].  Whereas, in our mock adb.py which is based on
SocketServer.TCPServer in python, when we call
SocketServer.TCPServer.shutdown() in the case of 'kill-server' command, the
server process doesn't exit soon since the shutdown() function just sets a
flag [2] and serve_forever() polls it [3] every |poll_interval| seconds,
|poll_interval| is 0.5 seconds by default.  Thus it's possible that new incoming
requests are processed during polling.

This is the real cause of the race condition that the adb server still keeps
alive when 'adb kill-server' finished.  So we don't need to the workaround
for the race condition.

[1] https://android.googlesource.com/platform/system/core/+/4039051d6ddb02324204930fb86d9d0fe405b3fb/adb/adb.cpp#1049
[2] https://github.com/python/cpython/blob/65b5ef02ec1f44e3a19b689a1ecf73d01c82161b/Lib/socketserver.py#L248
[3] https://docs.python.org/2/library/socketserver.html#SocketServer.BaseServer.serve_forever

Differential Revision: https://phabricator.services.mozilla.com/D3169
2018-08-13 06:08:34 +09:00
Hiroyuki Ikezoe 8044398538 Bug 1481699 - Send back 'OKAY' to the client when the adb server received 'kill-server' command. r=jdescottes
Because the genuine adb binary does it [1].  And doing it before shutdown
thread is created to make sure it's sent to the client.

[1] https://android.googlesource.com/platform/system/core/+/4039051d6ddb02324204930fb86d9d0fe405b3fb/adb/adb.cpp#1055

Differential Revision: https://phabricator.services.mozilla.com/D3168
2018-08-13 06:08:34 +09:00
Hiroyuki Ikezoe b39cca4936 Bug 1481699 - Rename ADBServer to ADBRequestHandler. r=jdescottes
Since it's actually a child of SocketServer.BaseRequestHandler.

Differential Revision: https://phabricator.services.mozilla.com/D3167
2018-08-13 06:08:33 +09:00
Hiroyuki Ikezoe 86e5de9c52 Bug 1481691 - Unpack files only if the devtools-adb-extension versionis mismatch or there are no unpacked files. r=jdescottes
getManifestFromUnpacked() and isUnpacked() are mostly the same as they are in
binary-manager.js [1] in the adbhelper addon.  A big difference is that the
manifest.json copied from the extension is the manifest.json for the
devtools-adb-extension itself, not manifest.json(s) in a subdirectory for
each platforms (e.g. linux/manifest.json).

Due to the verion check in each xpcshell test needs to use a different version
for the test extension, otherwise subsequent tests will use unpacked files in
the first test case, thus the ADB mock won't be used at all.

[1] https://github.com/mozilla/adbhelper/blob/0821424b6b895645560089a134054b35b6649ff8/binary-manager.js
2018-08-10 16:57:21 +09:00
Hiroyuki Ikezoe 1b8c70c4f5 Bug 1481691 - Rename extractBinary to extractFiles and make it return a boolean instead of path string. r=jdescottes
In the next patch, we will extract manifest.json in the extension into the
profile directory.  And returning a boolean will make getFileForBinary()
simple with the extension version check which will be also introduced in the
next patch.
2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe f6e3b58e0b Bug 1481691 - Drop |sync| argument from kill() and stop(). r=jdescottes
We've been using them as synchrous mode only.
2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe f69ae2febd Bug 1481691 - Use Promise instead of PromiseUtils. r=jdescottes 2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe 8667665868 Bug 1481691 - Drop root relevant stuff and push and pull. r=jedescottes
As far as I can tell they were all for FirefoxOS.
2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe 1a6bbdd8a4 Bug 1481691 - Drop code for FirefoxOS. r=jdescottes 2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe 94497efb29 Bug 1481691 - Drop code and comments for older versions of Firefox. r=jdescottes 2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe ab630c4f3d Bug 1481691 - Replace console.log and console.debug with dumpn. r=jdescottes 2018-08-10 16:32:21 +09:00
Hiroyuki Ikezoe fb1cbab0ed Bug 1481691 - Add a preference for the devtools-adb-extension id. r=jdescottes 2018-08-10 16:32:20 +09:00
Hiroyuki Ikezoe 253582bf0e Bug 1469054 - Skip some test cases in test_adb.js on Windows. r=jdescottes
On Windows testNoTargetBinaries fails since we don't remove extracted binaries
in the profile directory when the extension is removed.  The original adbhelper
addon doesn't remove them either, so this problem has been underlying
originally.  We will fix it in a later bug.

Also on Windows, testStartAndStop and testTrackDevices fail.  That's because,
I guess, the adb mock (adb.py) isn't launched properly.  I will handle it
once after I take a windows laptop back.

MozReview-Commit-ID: 15wo1S0pX37
2018-08-09 15:43:44 +09:00
Hiroyuki Ikezoe 0fe9ba0f54 Bug 1469054 - Make check() in adb-running-checker fail if a certain period of time elapsed. r=jdescottes
On MacOSX connecting to a port which is not started listening gets stuck
(bug 1481963), to avoid the stuck, we make forcibly the function fail.

MozReview-Commit-ID: COVplVPx3vA
2018-08-09 15:43:44 +09:00