Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Andreas Tolfsen 394ba9bb0b Bug 1476305 - Add pref to not truncate Marionette log messages. r=automatedtester
Marionette currently truncates a selection of log messages that
exceed 250 characters.  It is however sometimes, usually when
debugging locally, to not truncate logs so one can see exactly what
is sent to and fro the server.
2018-07-24 13:33:51 +01:00
Andreas Tolfsen 1c79ab9d74 Bug 1470646 - Silence missing nodeType property warning. r=whimboo
If val does not have a property nodeType, a warning is emitted to
the browser console.  This is observable when running the xpcshell
unit tests because we mock out val without a nodeType property.

MozReview-Commit-ID: GzqMoJQQdF8

--HG--
extra : rebase_source : be793524551751e96e2059907cfc3eed3602cde5
2018-06-23 14:00:50 +01:00
Coroiu Cristina cc751350dc Backed out 8 changesets (bug 1470646) for linting failure on a CLOSED TREE
Backed out changeset 9b8d9f803b25 (bug 1470646)
Backed out changeset 58e2010d2842 (bug 1470646)
Backed out changeset 2b19429d778f (bug 1470646)
Backed out changeset e543f592454a (bug 1470646)
Backed out changeset 22469044267d (bug 1470646)
Backed out changeset e5415b1e22f5 (bug 1470646)
Backed out changeset 13e47fa99a31 (bug 1470646)
Backed out changeset 42964d651f02 (bug 1470646)

--HG--
rename : testing/marionette/capabilities.js => testing/marionette/session.js
rename : testing/marionette/test/unit/test_capabilities.js => testing/marionette/test/unit/test_session.js
2018-07-02 17:56:27 +03:00
Andreas Tolfsen 248e715a91 Bug 1470646 - Silence missing nodeType property warning. r=whimboo
If val does not have a property nodeType, a warning is emitted to
the browser console.  This is observable when running the xpcshell
unit tests because we mock out val without a nodeType property.

MozReview-Commit-ID: GzqMoJQQdF8

--HG--
extra : rebase_source : b5b7c4ec6d48421078085cbd89b7667399c9f05b
2018-06-23 14:00:50 +01:00
Andreas Tolfsen 1c8c3887ef Bug 1469307 - Pretty-print Attr objects in format.pprint. r=whimboo
Attr objects are returned from Node.getAttribute() and this provides
a readable string like the one offered in devtools for them.

MozReview-Commit-ID: 60Pb0AV1tjt

--HG--
extra : rebase_source : e5ae61bdeb283f635714cd6b9d422eaeb0dbf0e4
2018-06-18 16:05:39 +01:00
Andreas Tolfsen a71e8dea4a Bug 1464469 - Use MarionetteLog throughout. r=whimboo
Replace direct invocations of Log.jsm with the new Marionette-specific
logger.

The patch also moves the Log.get() call to a lazy getter.

MozReview-Commit-ID: H1HoAgL2Cvs

--HG--
extra : rebase_source : 0e20a5c0100a359c8d8b627457fc178293387078
2018-06-06 14:40:05 +01:00
Kris Maglione 19a956c2c6 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
extra : amend_source : 09a90b29837e339eec7bdf8504f86c28e74ca3dd
extra : intermediate-source : a1eca62826a1341ca24d4d2a93d4884d4fc7ad51
extra : histedit_source : eb26e73b531f9a34d3401d39f60b533b27b78540
2018-01-18 16:27:26 -08:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione e050496c59 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
extra : amend_source : d0515fe4eb13b59cc490ca9d964ad9ee15ef3cd3
extra : intermediate-source : 6e56f4c8843ed134b2dba34fb007298fd55be966
extra : histedit_source : 88abf9f4ea4e740a9391278625ef07395205c3f5%2Cc14bc7a71eb413fcb573ed0d030fd7f99a1468f0
2018-01-18 16:27:26 -08:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione e70d01a9e9 Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor

--HG--
extra : rebase_source : 6286dcfd1a7c970272ac6befaccd3e47e90d2f6b
extra : intermediate-source : d48657228a0b84cf3a37a35227ca3b3d0bd2a017
extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf
2018-01-18 16:27:26 -08:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Andreas Tolfsen 95288d7450 Bug 1422593 - Pretty print WindowProxy and ChromeWindow. r=whimboo
Enhances format.pprint to also provide pretty-printing of WindowProxy
and ChromeWindow prototypes.

Unfortunately there is no good way of testing this because
Object.prototype.toString.call always gets the underlying prototype.

MozReview-Commit-ID: 5sKzJvpWVyc

--HG--
extra : rebase_source : ca021d78a19c49ad2c2a381832d25c201ee8b2e0
2017-12-03 15:48:13 +00:00
Henrik Skupin a6bbee2356 Bug 1405474 - Add more attributes for elements in pprint output. r=ato
Currently pprint only checks for 'id' and 'class', and adds
those to the output. Given that lots of elements might not
have those attributes a couple more should be added, which
can help to uniquly identify those.

MozReview-Commit-ID: 3thefe4oLN3

--HG--
extra : rebase_source : e9d276229a39ce5169a333ecb5b1fcc10e935d2a
2017-10-18 20:54:13 +02:00
Andreas Tolfsen 7974848c51 Bug 1408454 - Move error.pprint to format.pprint. r=whimboo
Pretty-printing an object belongs more naturally to the new format module.

MozReview-Commit-ID: AfXLMPAT5ar

--HG--
extra : rebase_source : 1074febec66df49745256fc9cd04b0fecd293919
2017-10-13 17:59:30 +01:00
Andreas Tolfsen 92ab47fa39 Bug 1403577 - Add utility for truncating strings. r=whimboo
Introduces a utility that truncates strings in potentially arbitrary
object structures.  This allows JSON structures that contain long
strings to be shortened with an " ..." appendix for pretty logging
when data integrity is not a vital concern.

The maximum string length is currently set to 250 characters, which
is a number I have pulled out of a hat.

MozReview-Commit-ID: 2gauOvMzBCO

--HG--
extra : rebase_source : cea57d348a61ecd11a5a9cf564ed60737923f380
2017-09-30 17:06:29 +01:00