These methods are only ever used in tests and no longer need to be exposed.
In test_bug445177.xul I tried to preserve more of the test, but everything
after the call to addBroadcastListenerFor is dependent on that.
MozReview-Commit-ID: C4vAxNir4O8
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] 4039051d6d/adb/adb.cpp (1049)
[2] 65b5ef02ec/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
Some test were relying on the existence of the complete function
and were using it in order to do integration test.
We modify those and instead trigger real user interaction for
making those assertions.
Additional test cases are added to the test files they fit in
so we have a broader coverage of user interaction in regard
to autocompletion.
Depends on D2825
Differential Revision: https://phabricator.services.mozilla.com/D2826
--HG--
extra : moz-landing-system : lando
We used to rely on different things to both display
the autocompletion text and accept an autocompletion.
This patches introduces new helper functions in order
to make the code more easy to reason about.
We also rollback our decision to show the popup when
there is only 1 item in the autocompletion list in
order to be more consistent with what Chrome does.
Differential Revision: https://phabricator.services.mozilla.com/D2824
--HG--
extra : moz-landing-system : lando
Entry storage allocation now occurs on the first lookupForAdd()/put()/putNew().
This removes the need for init() and initialized(), and matches how
PLDHashTable/nsTHashtable work. It also removes the need for init() functions
in a lot of types that are built on top of mozilla::Hash{Map,Set}.
Pros:
- No need for init() calls and subsequent checks.
- No memory allocated for empty tables, which are not that uncommon.
Cons:
- An extra branch in lookup() and lookupForAdd(), but not in put()/putNew(),
because the existing checkOverloaded() can handle it.
Specifics:
- Construction now can take a length parameter.
- init() is removed. Explicit length-setting, when necessary, now occurs in the
constructors.
- initialized() is removed.
- capacity() now returns zero when the entry storage is absent.
- lookupForAdd() is no longer `const`, because it can instantiate the storage,
which requires modifications.
- lookupForAdd() can now return an invalid AddPtr in two cases:
- old: hashing failure (due to OOM in the hasher)
- new: OOM while instantiating entry storage
The existing failure handling paths for the old case work for the new case.
- clear(), finish(), and clearAndShrink() are replaced by clear(), compact(),
and reserve(). The old compactIfUnderloaded() is also removed.
- Capacity computation code is now in its own functions, bestCapacity() and
hashShift(). setTableSizeLog2() is removed.
- uint32_t is used throughout for capacities, instead of size_t, for
consistency with other similar values.
- changeTableSize() now takes a capacity instead of a deltaLog2, and it can now
handle !mTable.
Measurements:
- Total source code size is reduced by over 900 lines. Also, lots of existing
lines got shorter (i.e. two checks were reduced to one).
- Executable size barely changed, down by 2 KiB on Linux64. The extra branches
are compensated for by the lack of init() calls.
- Speed changed negligibly. The instruction count for Bench_Cpp_MozHash
increased from 2.84 billion to 2.89 billion but any execution time change was
well below noise.
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] 0821424b6b/binary-manager.js
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.
Expressions like `window . addEventListener` are perfectly valid in JS,
but our autocompletion provider wasn't working well in such case.
We modify the JSPropertyProvider to make sure to handle this kind of
syntax and add test cases to make sure it works as intended.`
Differential Revision: https://phabricator.services.mozilla.com/D2988
--HG--
extra : moz-landing-system : lando
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
--HG--
extra : rebase_source : 3a8c60c174def8f24517e10d916384c5fa5ce45c
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
--HG--
extra : rebase_source : 2f048e8e8aa7e9b9212c6cfa31f3589b73e0087c
There is a race condition that when we adb.start() finishes, i.e. the ADB server
is launched, the ADB server is not ready to listen from clients yet. To avoid
this race condition in adb.start() function, we do wait until the server gets
ready.
MozReview-Commit-ID: EfSLA9uvhI9
--HG--
extra : rebase_source : 7b5938a3a7687e7072352aa65674631d2b1ee429
It seems that, on chaos mode, we can't receive whole data set at once, i.e.
sending data will be split into some chunks, so the adb mock should check the
sent data length and if there remains still data which has to be sent, we have
to continue sending the rest of the data.
MozReview-Commit-ID: 5jeEH8KpNNW
--HG--
extra : rebase_source : 69bc849a48db649bf4f4786456464d3556a903d7
I am not sure this had caused real issue though.
MozReview-Commit-ID: ISSSJCYcpAm
--HG--
extra : rebase_source : 515934abf244d7cee2605117b3fffc22d88d355b
Changes are:
- s/let/const/g if applicable
- braces for 'if' block
- identation fixes
- Moved a statement in setTimeout callback on the next line.
MozReview-Commit-ID: HyZ9zrbK3iJ
--HG--
extra : rebase_source : 61f217419778cee2e94786f1a9a6c9647dda0f87
Without this change, the test in this patch does fail since when the test
starts, the adb server is still running for the previous test, thus
ADB.start() doesn't start a new adb server, then after that when we check
that the adb server is running by adb-running-checker, it tells us the adb
server is NOT running at that moment.
MozReview-Commit-ID: KRo30WmAsAY
--HG--
extra : rebase_source : 96348d8ee94df375b36b3d68683c292cd770fe86
The new devtools-adb-extension should have adb.json on the top of the extension
directory, and devtools fetches the adb.json and parses it then copies the blobs
into local profile directory.
NOTE: Though we are going to use the same adb.json for all platforms, we will
pack only the corresponding blobs for each platform. E.g. the extension for
Linux64 will have only linux64/adb.
The adb.json should look like this;
{
"Linux": {
"x86": [
"linux/adb"
],
"x86_64": [
"linux64/adb"
]
},
"Darwin": {
"x86_64": [
"mac64/adb"
]
},
"WINNT": {
"x86": [
"win32/adb.exe",
"win32/AdbWinApi.dll",
"win32/AdbWinUsbApi.dll"
],
"x86_64": [
"win32/adb.exe",
"win32/AdbWinApi.dll",
"win32/AdbWinUsbApi.dll"
]
}
}
unpackFile() here is mostly the same as in binary-manager.js in the adbhelper
addon.
MozReview-Commit-ID: 7aprfaaeTAT
--HG--
extra : rebase_source : 64c55066207a21782c0cbd0ca2294baf1ab61d40
Allows non-XUL chrome privilege documents to also use the command
dispatcher. The command dispatcher is created lazily since it will not
always be used.
Update test to reflect removal of the XUL attribute "commandDispatcher"
from content privilege XUL.
MozReview-Commit-ID: HUXMG9kx4ft
parseDeclarations was ignoring html comment tokens, but in fact they
should not be treated any differently from other CSS tokens.
MozReview-Commit-ID: 27Mxt5zbSSJ
--HG--
extra : amend_source : 91e47bbf6951ac9dd4709ac10c49ff51c1781ce8