Closed
Bug 876250
Opened 11 years ago
Closed 4 years ago
Mozmill test files re-import mozmill and elementlibs already provided by the loader
Categories
(Thunderbird :: Testing Infrastructure, defect)
Thunderbird
Testing Infrastructure
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: tessarakt, Unassigned)
References
()
Details
The Mozmill file loader already injects several components into all loaded files: http://mxr.mozilla.org/comm-central/source/mail/test/resources/mozmill/mozmill/extension/resource/modules/frame.js#86 > module.mozmill = mozmill; > module.elementslib = elementslib; test-folder-helpers.js does this: http://mxr.mozilla.org/comm-central/source/mail/test/mozmill/shared-modules/test-folder-display-helpers.js > var elib = {}; > Cu.import('resource://mozmill/modules/elementslib.js', elib); > var mozmill = {}; > Cu.import('resource://mozmill/modules/mozmill.js', mozmill); Same holds, e.g., for test-window-helpers.js. These redundant imports should be removed. Where necessary, references to "elib" have to be replaced with "elementslib".
elementslib is imported in tons of tests. If it is unneded, removing the imports could speed up the tests a bit.
Comment 2•11 years ago
|
||
Isn't the whole point of modules that you can import them multiple times and they are still only evaluated once? In that case that speed up is likely not even measurable.
Probably yes, but it may reduce the clutter in the headers of many tests.
Comment 4•11 years ago
|
||
OTOH, if it's declared in the header you know what to expect - and there's less magic...
Reporter | ||
Comment 5•11 years ago
|
||
(In reply to Magnus Melin from comment #4) > OTOH, if it's declared in the header you know what to expect - and there's > less magic... IMO, the real question is: What is the API "guaranteed" by Mozmill? Should we rather rely on being able to import from resource://mozmill/modules/*.js or on having the symbols elementslib and mozmill provided in the scope of each script? Maybe ask upstream?
Comment 6•4 years ago
|
||
mozmill is gone.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•