Commit Graph

142 Commits

Author SHA1 Message Date
Myk Melez
25349d2601 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Kris Maglione
ee6633da5c Bug 1478124: Part 1 - Update component mocks to replace and restore components sanely. r=froydnj
For static components, I don't intend to allow removing or replacing CID
entries, only contract ID entries. And I would generally prefer, when
restoring overrides of those classes, to not create a new dynamic factory
entry for the contract ID.

We already have the ability to mock components without either of those issues,
but registering a new CID entry for the mock (without unregistering the
original), and then restoring the original by calling `registerFactory` with a
null factory object.

This patch updates our existing mocks to behave that way, and paves the way
for the rest of the patches.

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

--HG--
extra : rebase_source : 449f37ae8a3cc970e5f864d10e43e88d9e7e4bf6
extra : source : bedaa9c437ad30ea88bdc0e8fc83f4a2e980812e
2018-12-19 15:49:48 -08:00
arthur.iakab
c1fae83952 Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE
Backed out changeset fce62c77a56b (bug 1478124)
Backed out changeset eb2fa3b5edf7 (bug 1478124)
Backed out changeset 8dacce59fcc0 (bug 1478124)
Backed out changeset 012fd0107204 (bug 1478124)
Backed out changeset 496aaf774697 (bug 1478124)
Backed out changeset 21f4fda03159 (bug 1478124)
Backed out changeset b0444e0bc801 (bug 1478124)
Backed out changeset d94039b19943 (bug 1478124)
Backed out changeset 5d85deac61c2 (bug 1478124)
Backed out changeset 929fd654c9df (bug 1478124)
Backed out changeset 1ddd80d9e91a (bug 1478124)
Backed out changeset b8d2dfdfc324 (bug 1478124)
Backed out changeset f500020a273a (bug 1478124)
Backed out changeset dd00365ebb55 (bug 1478124)
Backed out changeset 538e40c5ee13 (bug 1478124)
Backed out changeset bedaa9c437ad (bug 1478124)
2019-01-29 10:03:06 +02:00
Kris Maglione
f1f3101eb5 Bug 1478124: Part 1 - Update component mocks to replace and restore components sanely. r=froydnj
For static components, I don't intend to allow removing or replacing CID
entries, only contract ID entries. And I would generally prefer, when
restoring overrides of those classes, to not create a new dynamic factory
entry for the contract ID.

We already have the ability to mock components without either of those issues,
but registering a new CID entry for the mock (without unregistering the
original), and then restoring the original by calling `registerFactory` with a
null factory object.

This patch updates our existing mocks to behave that way, and paves the way
for the rest of the patches.

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

--HG--
extra : rebase_source : 61ef2435d764c2d9daee6a16515eb0efd94a6454
2018-12-19 15:49:48 -08:00
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
Mark Banner
0304564ac7 Bug 1415483 - Apply the new options to reject-importGlobalProperties across the codebase, remove unnecessary importGlobalProperties. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D13754

--HG--
extra : moz-landing-system : lando
2018-12-11 21:39:40 +00:00
Csoregi Natalia
9e970681f2 Backed out 2 changesets (bug 1415483) for multiple failures e.g. on test_message_manager_ipc.html. CLOSED TREE
Backed out changeset d00748de66fc (bug 1415483)
Backed out changeset 8dea94258f54 (bug 1415483)
2018-12-11 19:30:57 +02:00
Mark Banner
1abdc8687f Bug 1415483 - Apply the new options to reject-importGlobalProperties across the codebase, remove unnecessary importGlobalProperties. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D13754

--HG--
extra : moz-landing-system : lando
2018-12-11 14:09:44 +00:00
Nika Layzell
11b083d72c Bug 1477432 - Part 9: Switch to using plain JS objects for nsIJS[IC]ID, r=mccr8
This is a complete rewrite of the interface while maintaining the same APIs.
Each ID is fully-contained within a single object, does not require a finalizer,
and is cheap to create.

Beyond using reserved slots, this code avoids using custom ClassOps, instead
preferring Symbol.hasInstance and eager constants.

One major change which occurred in this patch was the move from storing a nsCID
to storing the ContractID for JSCID objects. This eliminates the need for the
'refreshCID' method, and hopefully shouldn't have performance implications.

If we discover that there are performance problems there, we can look into
stashing the CID, and re-introduce 'refreshCID', despite its surprising
behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D2286
2018-11-16 17:27:44 -05:00
Nika Layzell
7954235168 Bug 1477432 - Part 5: Add a refreshCID method to JSCID objects, r=mccr8
This lets us get rid of the method 'initalize', which currently needs the
internal representation of JSCID.

This particular method is removed entirely in Part 9, and only exists to keep
intermediate states building & running.

Differential Revision: https://phabricator.services.mozilla.com/D2282
2018-11-16 17:27:37 -05:00
Julian Descottes
b346dbfd69 Bug 1467712 - Fail if Assert.ok is called with more than 2 arguments;r=Standard8
Depends on D10416

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

--HG--
extra : moz-landing-system : lando
2018-11-01 13:50:22 +00:00
Csoregi Natalia
faba2c8c15 Backed out 4 changesets (bug 1467712) for multiple failures with: Too many arguments passed to ok. CLOSED TREE
Backed out changeset 9ce0ac2b9d71 (bug 1467712)
Backed out changeset 026eb1f6dc6e (bug 1467712)
Backed out changeset 0088a09d869a (bug 1467712)
Backed out changeset 1b19ea76aad6 (bug 1467712)
2018-11-01 15:22:52 +02:00
Julian Descottes
d771830152 Bug 1467712 - Fail if Assert.ok is called with more than 2 arguments;r=Standard8
Depends on D10416

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

--HG--
extra : moz-landing-system : lando
2018-11-01 11:10:36 +00:00
Mark Banner
ceaeb93550 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389

--HG--
extra : moz-landing-system : lando
2018-10-19 12:55:39 +00:00
Andrew Swan
3badf01810 Bug 1449055 Convert formautofill to a webextension r=MattN,kmag
--HG--
rename : browser/extensions/formautofill/bootstrap.js => browser/extensions/formautofill/api.js
rename : browser/extensions/formautofill/install.rdf.in => browser/extensions/formautofill/manifest.json
rename : browser/extensions/formautofill/skin/shared/autocomplete-item.css => browser/extensions/formautofill/skin/shared/autocomplete-item-shared.css
rename : browser/extensions/formautofill/skin/shared/editDialog.css => browser/extensions/formautofill/skin/shared/editDialog-shared.css
extra : rebase_source : 8ddd40e3bbf84fadb7ef07b30822030e346ae341
extra : intermediate-source : 45306ff933fe8dfad0ab11b2f4072389b15fd993
extra : source : ecda6532c852b3f225fce998e3ce83ad157760e6
2018-07-28 14:06:07 -07:00
Csoregi Natalia
b0afa69be5 Backed out 3 changesets (bug 1449055) for multiple xpcshell failures on browser/extensions/formautofill/test/ . CLOSED TREE
Backed out changeset fc97f5b5e65d (bug 1449055)
Backed out changeset 45306ff933fe (bug 1449055)
Backed out changeset da3100049ef2 (bug 1449055)

--HG--
rename : browser/extensions/formautofill/api.js => browser/extensions/formautofill/bootstrap.js
rename : browser/extensions/formautofill/manifest.json => browser/extensions/formautofill/install.rdf.in
rename : browser/extensions/formautofill/skin/shared/autocomplete-item-shared.css => browser/extensions/formautofill/skin/shared/autocomplete-item.css
rename : browser/extensions/formautofill/skin/shared/editDialog-shared.css => browser/extensions/formautofill/skin/shared/editDialog.css
2018-08-16 00:15:19 +03:00
Andrew Swan
fb72dcb414 Bug 1449055 Convert formautofill to a webextension r=MattN,kmag
--HG--
rename : browser/extensions/formautofill/bootstrap.js => browser/extensions/formautofill/api.js
rename : browser/extensions/formautofill/install.rdf.in => browser/extensions/formautofill/manifest.json
rename : browser/extensions/formautofill/skin/shared/autocomplete-item.css => browser/extensions/formautofill/skin/shared/autocomplete-item-shared.css
rename : browser/extensions/formautofill/skin/shared/editDialog.css => browser/extensions/formautofill/skin/shared/editDialog-shared.css
extra : rebase_source : 233ea805630209a07d347e19f19710d9755f595f
extra : source : ecda6532c852b3f225fce998e3ce83ad157760e6
2018-07-28 14:06:07 -07:00
Dorel Luca
d1bfb0cc14 Backed out 2 changesets (bug 1449055) for xpcshell failures on browser/extensions/formautofill/test/unit/heuristics/test_de_fields.js. CLOSED TREE
Backed out changeset 644216b0ad9b (bug 1449055)
Backed out changeset ecda6532c852 (bug 1449055)

--HG--
rename : browser/extensions/formautofill/api.js => browser/extensions/formautofill/bootstrap.js
rename : browser/extensions/formautofill/manifest.json => browser/extensions/formautofill/install.rdf.in
rename : browser/extensions/formautofill/skin/shared/autocomplete-item-shared.css => browser/extensions/formautofill/skin/shared/autocomplete-item.css
rename : browser/extensions/formautofill/skin/shared/editDialog-shared.css => browser/extensions/formautofill/skin/shared/editDialog.css
2018-08-14 05:31:58 +03:00
Andrew Swan
2a4999d7a5 Bug 1449055 Convert formautofill to a webextension r=MattN,kmag
--HG--
rename : browser/extensions/formautofill/bootstrap.js => browser/extensions/formautofill/api.js
rename : browser/extensions/formautofill/install.rdf.in => browser/extensions/formautofill/manifest.json
rename : browser/extensions/formautofill/skin/shared/autocomplete-item.css => browser/extensions/formautofill/skin/shared/autocomplete-item-shared.css
rename : browser/extensions/formautofill/skin/shared/editDialog.css => browser/extensions/formautofill/skin/shared/editDialog-shared.css
extra : rebase_source : 0d766ddf49ddbdb7f1efcb583f2684adaba13b0d
2018-07-28 14:06:07 -07:00
Mark Banner
e6cf2a84d1 Bug 1478305 - Remove unnecessary ChromeUtils.import calls in testing/. r=mossop
MozReview-Commit-ID: AGwzWcQ7aWM

--HG--
extra : rebase_source : b575847ac13955f3cab75bb8900b6dae9fd693d5
2018-07-30 10:40:22 +01:00
Mark Banner
0e18da0420 Bug 1452706 - Make the 'expected' argument to Assert.throws/rejects required rather than optional. r=mikedeboer
MozReview-Commit-ID: 25flGw5sWga

--HG--
extra : rebase_source : 5212db5e4f940906646078542641f449d46a1684
2018-06-01 14:33:31 +01:00
Coroiu Cristina
e631b8c1ea Backed out 3 changesets (bug 1452706) for xpcshell failures at devtools/server/tests/unit/test_format_command.js
Backed out changeset 6abc5dc6baaf (bug 1452706)
Backed out changeset 4fbd34b0807a (bug 1452706)
Backed out changeset 626c790eb6f3 (bug 1452706)
2018-07-04 21:20:21 +03:00
Mark Banner
a952f2e027 Bug 1452706 - Make the 'expected' argument to Assert.throws/rejects required rather than optional. r=mikedeboer
MozReview-Commit-ID: 25flGw5sWga

--HG--
extra : rebase_source : 635355c8b75c1de9f1e4fb17b903bfa7c52bf702
2018-06-01 14:33:31 +01:00
Kris Maglione
01c298aca6 Bug 1460092: Add ESLint rule to enforce use of ChromeUtils.generateQI. r=Gijs
Also fixes existing code which fails the rule.

MozReview-Commit-ID: CkLFgsspGMU

--HG--
extra : rebase_source : 86a43837659aa2ad83a87eab53b7aa8d39ccf55b
2018-05-08 18:36:22 -07:00
Mark Banner
c6433f5a9a Bug 1458235 - Make Assert.* fail if the message argument is defined but not a string. r=Gijs
MozReview-Commit-ID: 9Kfcz0WORXS

--HG--
extra : rebase_source : adf70843a2f8783131454cc41a58a4fcf6ec78b1
2018-05-01 15:36:51 +01:00
Kris Maglione
a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Boris Zbarsky
76ead58490 Bug 1455674 part 19. Get rid of JS uses of nsIDOMElement. r=qdot
In nsBlocklistService.js we know we're dealing with actual nodes, so .nodeType
checks should be fine.
2018-04-26 23:37:34 -04:00
Andrew Halberstadt
3abe4366e0 Bug 1452432 - Convert 'test' field to a string in assertionCount StructuredLog.jsm messages, r=gbrown
For messages that have a test field (like testStart/testStatus/testEnd/etc),
the StructuredLog.jsm module converts the field to a string if it was an Array
(as used by reftest). It looks like the assertionCount message accidentally got
left out.

I don't believe this conversion should be happening in StructuredLog.jsm. It
should either happen in the formatters, or in reftest.jsm. But for now it's
better to be consistent. Another bug for another time.

MozReview-Commit-ID: DjdoEqxoujT

--HG--
extra : rebase_source : 4303eb9024835884fcf60c334f4d206db0ee6e3f
2018-04-09 11:50:05 -04:00
Florian Quèze
c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Florian Quèze
682b1ec3b2 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Thom Chiovoloni
872a82220c Bug 1439772 - Avoid truncating operands when reporting failure for Assert.deepEqual r=mikedeboer
MozReview-Commit-ID: 1hlYFE3Xcwn

--HG--
extra : rebase_source : 5b55d4721dd403f7baf47f55b9dfc62ccd189861
2018-02-20 18:17:16 -05:00
Mark Banner
01319d9d04 Bug 1437584 - Enable ESLint rule mozilla/use-services for testing/. r=jmaher
MozReview-Commit-ID: DMkgj5UAId4

--HG--
extra : rebase_source : 155f657e68f04850e878535afdb1421933b4a13b
2018-02-12 17:10:00 +00:00
Greg Mierzwinski
1c4584793b Bug 1435040 - Remove object iterator implementation from CoverageUtils.jsm. r=bz
This patch removes the object iterator implementation that was used to fix bug 1317019 in favor of using Object.entries() when recording method-level JS code coverage through the JS Debugger.

MozReview-Commit-ID: AxeG5QglwRm

--HG--
extra : rebase_source : 36a09469ddf1a9a6fa0954aadc53534a4308d2b0
2018-02-02 11:44:26 -05:00
Andrew McCreight
5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -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
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
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
Rofael Aleezada
8f5033ab9d Bug 1428845 - Removed duplicate definition of waitForCondition(). r=johannh
MozReview-Commit-ID: UCZwR5eRc5

--HG--
extra : rebase_source : 55b319a5d3e2e20003868b81c629e30eb5173dfc
2018-01-22 18:50:32 -06:00
Ciure Andrei
1ec36c1e93 Backed out changeset 3325c31e498c (bug 1423247) for taking a new approach targeting Mozilla59 r=backout a=backout on a CLOSED TREE 2017-12-20 01:46:37 +02:00
Drew Willcoxon
7e756780ec Bug 1423247 - Couple Awesome Bar Composition (matchBuckets pref) to user's Address bar state (unified vs. 2 bar). r=mak
MozReview-Commit-ID: LZIWVcDvMrK

--HG--
extra : rebase_source : fc6f1c71641601ff40e289b13a70bc67039b10b4
2017-12-14 14:14:10 -08:00
Andrew Halberstadt
7f664cfdaf Bug 1209463 - [test] Log suite names in test harnesses, r=gbrown
Suite names are currently only used by formatters to print out
an overall summary from |mach test| and |mach mochitest|. So
this doesn't need to be exact and can be tweaked further at a
later date.

If multiple test invocations have the same suite name, their
results will be merged in the overall summary. If a suite name
is missing, the summary will contain a placeholder name.

MozReview-Commit-ID: K1xpb9hUQRX

--HG--
extra : rebase_source : cc8cc8b36255d939dd5dffd3c5444c34951ac8e2
2017-11-27 17:20:06 -05:00
aceman
996910e5ce Bug 1422547 - Define uniqueProcessID in newAppInfo of testing/modules/AppInfo.jsm as it is accessed in xpcshell tests and ExtensionUtils.jsm. r=mccr8 2017-12-02 16:16:00 +02:00
aceman
09f4e1d218 Bug 1420758 - Define processType in newAppInfo of testing/modules/AppInfo.jsm as it is accessed in xpcshell tests. r=mccr8 2017-11-27 14:21:00 -05:00
Andreea Pavel
c29bb2e0be Backed out 1 changesets (bug 1420758) for xpcshell failures, e.g. browser/modules/test/unit/test_LaterRun.js r=backout a=backout a=backout on a CLOSED TREE
Backed out changeset b2ac071a8544 (bug 1420758)
2017-11-27 16:52:38 +02:00
aceman
fe60e4df87 Bug 1420758 - define processType in newAppInfo of testing/modules/AppInfo.jsm as it is accessed in xpcshell tests. r=mccr8 2017-11-26 14:47:00 +02:00
Dan Banner
b2e847755c Bug 1367704 - Enable the semi ESLint rule across the tree. r=standard8
MozReview-Commit-ID: GrlcOI9K2hJ

--HG--
extra : rebase_source : 6574cf3c67eb11733ffd9999c260f71c8551abc4
2017-05-28 19:57:46 +01:00
Paolo Amadini
8c27468e31 Bug 1413438 - Restore the logic preventing access denied errors when removing temporary files on Windows. r=mak
MozReview-Commit-ID: B4NG5XqNg9m

--HG--
extra : rebase_source : 368e3ca8130c85d9791feb524996f1b14e093744
extra : source : 98e4cee0879f356d2f4d61e76aa0fb50f174f55a
2017-11-06 08:34:40 +00:00
Kit Cambridge
064ed56076 Bug 1368209 - Refactor Engine::_processIncoming into three stages. r=eoger,tcsc
* In the first stage, we fetch changed records, newest first, up to the
  download limit. We keep track of the oldest record modified time we
  see.
* Once we've fetched all records, we reconcile, noting records that
  fail to decrypt or reconcile for the next sync. We then ask the store
  to apply all remaining records. Previously, `applyIncomingBatchSize`
  specified how many records to apply at a time. I removed this because
  it added an extra layer of indirection that's no longer necessary,
  now that download batching buffers all records in memory, and all
  stores are async.
* In the second stage, we fetch IDs for all remaining records changed
  between the last sync and the oldest modified time we saw in the
  first stage. We *don't* set the download limit here, to ensure we
  add *all* changed records to our backlog, and we use the `"oldest"`
  sort order instead of `"index"`.
* In the third stage, we backfill as before. We don't want large deltas
  to delay other engines from syncing, so we still only take IDs up to
  the download limit from the backlog, and include failed IDs from the
  previous sync. On subsequent syncs, we'll keep fetching from the
  backlog until it's empty.

Other changes to note in this patch:

* `Collection::_rebuildURL` now allows callers to specify both `older`
  and `newer`. According to :rfkelly, this is explicitly and
  intentionally supported.
* Tests that exercise `applyIncomingBatchSize` are gone, since that's
  no longer a thing.
* The test server now shuffles records if the sort order is
  unspecified.

MozReview-Commit-ID: 4EXvNOa8mIo

--HG--
extra : rebase_source : f382f0a883c5aa1f6a4466fefe22ad1a88ab6d20
2017-11-01 11:09:57 -07:00