***
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
Moves the innards of assert.acyclic to evaluate.isCyclic so it can
be called externally without throwing. It makes more sense for
this function to be exposed on the evaluate module, since other
behaviour related to JSON marshaling is also defined there.
MozReview-Commit-ID: 4WjEy8Sjqrm
--HG--
extra : rebase_source : 88cd829f3e178ec49ae532ea0af0a62defb4469f
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
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
The forthcoming window tracking refactoring introduces the new
abstractions ContentContext and ChromeContext that to a large extent
share the same interface. They make it possible to interact with
both types of browsing context in a uniform manner.
Marionette currently has a lot of convoluted if-conditions to
paper over the differences between ChromeWindow, <xul:browser>,
and browser.Context. Examples of this includes the assert.window
and assert.contentBrowser assertions: they essentially perform the
same job, but does not share the same API because the underlying
APIs they call are different.
In an effort to prepare Marionette for the window tracking refactoring,
this patch adds a bit of glue to combine them both into one assertion
called assert.open. This checks that the browsing context has not
been discarded.
MozReview-Commit-ID: K5e7Sr1mq0
Introduces a new assert.acyclic assertion helper function that uses
JSON.stringify to test if the input contains cyclic object references.
A JavaScriptError will be thrown if the object is not acyclic.
MozReview-Commit-ID: 3y8pnkPgf2k
--HG--
extra : rebase_source : 069ae9e1e6d3738c8712fe5c1838f6d3a91125e4
* Changed positiveInteger to validate upper bounds
* Removed processing for the no longer existent 'session' field
* Added default values for absent fields
MozReview-Commit-ID: E4x6TyMwZQs
--HG--
extra : rebase_source : 745cfeb0e3757651ed20f04de19eccb98eea9fc5
Pretty-printing an object belongs more naturally to the new format module.
MozReview-Commit-ID: AfXLMPAT5ar
--HG--
extra : rebase_source : 1074febec66df49745256fc9cd04b0fecd293919
pprint is currently exposed twice: once on the error namespace and once
separately. We only want to expose it once, and since there are only a
handful "error.pprint" usages left, we can go ahead and make this change.
When we move transition to use "require" in the future, like devtools
does, it will be possible to use both "error.pprint" and "pprint" styles
without export duplication.
MozReview-Commit-ID: CAnPDWn9Vr7
--HG--
extra : rebase_source : 05a05460d710eb96fa7b20cb94477be0282809de
The WebDriver service in the remote protocol accepts sessionId and
session_id and we only need on. All known consumers are using sessionId,
and we can drop the session_id fallback.
MozReview-Commit-ID: 6fa5Lgkzwfu
Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.
MozReview-Commit-ID: F9duuQoOYBt
--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
Instead of importing everything from the testing/marionette/error.js
module into the global scope, we need to be selective about what symbols
we want.
MozReview-Commit-ID: HZDAS0bs0GD
--HG--
extra : rebase_source : 14a300bb2cedc0716168d50846755a6faed83012
The err argument to assert.object is currently being dropped, which
means we loose the specialised and the custom error message.
This patch propagates the error message like we do for all other
assertions in this module.
MozReview-Commit-ID: GwuBSbqKfk1
--HG--
extra : rebase_source : 86c57aaaf60526eaf65345b9d5e38378920419e3
Due to the current caching of this.tab in browser.js the assertion
for the contentBrowser would fail. As such additionally assert that
the currently selected chrome window has not been closed yet.
Also assert.window should better check the 'closed' property instead
of handling a possible TypeError.
MozReview-Commit-ID: B79czg3dsux
--HG--
extra : rebase_source : 31bf31d2151e4b461574101ce7770d38fb92bd5c
When accessing a property of the current content browser from
the parent process, the current top-level browsing context has
to be valid.
MozReview-Commit-ID: BZHJTk1j5Nj
--HG--
extra : rebase_source : 7e44fc6e05d7fb1429fb3e36e897cf51b3d9142f
Add preliminary support for returning unexpected alert open errors when
calling commands that require it according to the WebDriver standard.
Also fixes a faulty test that seems to believe it is fine to click an
element whilst an alert is present.
Further work needs to be done on user prompts, asserts, and the handler
for user prompts in https://bugzilla.mozilla.org/show_bug.cgi?id=1264259.
MozReview-Commit-ID: BiWURoQECji
--HG--
extra : rebase_source : caa1506a0e972c7ad0da2d31993fb0b8ecc1ee17
The assertion method is used to check for a valid window. But it can fail
itself when already accessing the ChromeWindow. To fix that we have to
catch a possible TypeError and let the method throw a NoSuchWindowError
instead.
MozReview-Commit-ID: 3Uaio4a3HtA
--HG--
extra : rebase_source : 5c672e441789e45b4972b0f8fde8471b4998394d
Update necessary commands in driver.js to conform with webdriver spec by checking for a valid chrome window,
before executing the actual command.
MozReview-Commit-ID: Ad67SPx8vBx
--HG--
extra : rebase_source : 560b0807c72efb513027abcde3bf7af38aca602a
Update necessary commands in driver.js to conform with webdriver spec by checking for a valid chrome window,
before executing the actual command.
MozReview-Commit-ID: Ad67SPx8vBx
--HG--
extra : rebase_source : 356f6aadad8e8a8cb53578bf1c194a3a26fb2e45
Since bug 1326534 we have discarded the original stacktrace from errors
originating inside Marionette. This was due to faulty logic when
attempting to generate a new stacktrace when it was missing from a
propagated error.
This change simplifies WebDriver errors by making use of Error
inheritance. The WebDriver error specific functions error.toJson and
error.fromJson has additionally been moved to WebDriverError.
MozReview-Commit-ID: C3Ns0H01LyG
--HG--
extra : rebase_source : 0c705054dae8c0647500bb90e9b970cc57e712c4
These are leftover from review of Bug 1320389. I must have forgotten to
re-push to MozReview.
MozReview-Commit-ID: ENTFdmCsv6I
--HG--
extra : rebase_source : 3c6961fb1826cb7cc00d1bd6048ed2c94c9a2f1a