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
Reorder imports so that global ones are done before local imports.
MozReview-Commit-ID: 7xA9XQlxlj4
--HG--
extra : rebase_source : b144401c5c6c47e87beab669f76f2b61fb79e5b6
It will help a lot for debugging when the outer window id of the
content window gets logged when the frame script gets registered.
MozReview-Commit-ID: D64A1nPEs6l
--HG--
extra : rebase_source : 0e592e10cb1a0979f4331b92dbfcfc905e737120
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.
The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.
For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.
MozReview-Commit-ID: JOFvtmH7tg
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.
The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.
For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.
MozReview-Commit-ID: JOFvtmH7tg
--HG--
extra : rebase_source : ab5a2ef2e450b9bbdc6bc3c9487ed5dfda2c1d4b
Reorder imports so that global ones are done before local imports.
MozReview-Commit-ID: 7xA9XQlxlj4
--HG--
extra : rebase_source : b144401c5c6c47e87beab669f76f2b61fb79e5b6
It will help a lot for debugging when the outer window id of the
content window gets logged when the frame script gets registered.
MozReview-Commit-ID: D64A1nPEs6l
--HG--
extra : rebase_source : 0e592e10cb1a0979f4331b92dbfcfc905e737120
The cookie service relies on the current document's
domain which is accessible from chrome space through
this.curBrowser.contentBrowser.contentURI.host.
As it is implemented currently, Marionette's cookie service jumps
between chrome- and content space more than necessary. This incurs
significant serialisation and IPC overhead, considering that the domain,
hostname, and current path information is readily available in chrome
space.
This patch removes all cookie-related functionality from
testing/marionette/listener.js, and implements a pure chrome-only
version of the service. It does, however, not try to fix conformance
issues with the WebDriver specification, of which there are many.
Some of the algorithms, especially to do with iteration over cookies,
implemented in cookie.iter, is also highly suboptimal. I have not
fundamentally changed any algorithms, and so my recommendation is to
address this later when addressing potential conformance bugs.
MozReview-Commit-ID: Fgs8ocbDJxb
--HG--
extra : rebase_source : 16470d5341459e40b1ceed12728451d517bbc490
Marionette uses singular module names. Make the cookie module
fall in line by renaming it from testing/marionette/cookies.js to
testing/marionette/cookie.js.
MozReview-Commit-ID: H4jyvI3lFxz
--HG--
rename : testing/marionette/cookies.js => testing/marionette/cookie.js
extra : rebase_source : 6da48d3d9215de34ccb97823c0430766538fb45f
The expires property on nsICookie2 does not exist and we are
consequently returning it as undefined, which gets omitted in the JSON
serialisation to the client.
This patch changes it to return the correct property so that the expiry
property is returned as part of the serialised cookie.
MozReview-Commit-ID: IIjf4NWnUoQ
--HG--
extra : rebase_source : 5e2dc27fb550a010dcbe40eee49d9ae31244d749
Marionette exposes a global called "global" to scripts that are
evaluated in sandboxes. This is no longer needed after the rewrite of
the testing/marionette/evaluate.js module.
MozReview-Commit-ID: BobdwilaCy0
--HG--
extra : rebase_source : 96df7df0711eba9833b7e1198ffab0768b87e5cb
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : cbb6667bb0d8be65c34c6e84b70caf21c6b3c34d
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.
MozReview-Commit-ID: 4qaB3vxQzon
--HG--
extra : rebase_source : 7297648ed73faf326dc98f9c26604a447d658beb
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : b12fd8ce04e7da739a8a5ec0e7b30b6734c58e4a
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.
MozReview-Commit-ID: 4qaB3vxQzon
--HG--
extra : rebase_source : 3af2c7655ecd2d03f266d0a1ad02eadfea1b1a0b
setTestName was used for logging which test was being run for the
JS Tests used in B2G.
MozReview-Commit-ID: FNF4Sm7vAYM
--HG--
extra : rebase_source : 6ad739d2ff9bf3d6bafaed0450c8794a257657e7
This is a remanent of the B2G code for injecting Mochitest style tests
into Gecko. This is no longer used by anything and is now dead code.
MozReview-Commit-ID: 4qaB3vxQzon
--HG--
extra : rebase_source : b4b7e66452b7ce7335ef5f509957121f403d7043
When we enable "dom.forms.datetime", <input type=date> and <input type=time>
are displayed as multi-field text box, where the fields are ordered depending
on locale. To avoid too much overhead, instead of synthesising each key event,
we set the element's value property and fire the corresponding events to
emulate user interaction.
MozReview-Commit-ID: Ao6ip61CNT6
--HG--
extra : rebase_source : f03d9c5d2e2540e6c2189b542d9270be5fb63919
This removes importScript functionality that was used extensively for
B2G testing but is no longer used in tree.
MozReview-Commit-ID: 1O7GWCZPWRZ
--HG--
extra : rebase_source : dc57710690116d9f473271f88f43f298590e895e
There is no reason for the command to call into the content framescript.
It's only adding overhead and can currently cause hangs if the framescript
gets reloaded.
Instead use the content browser which is always aware of the current URL.
MozReview-Commit-ID: 9Ui7qClFEWJ
--HG--
extra : rebase_source : e428e71ddb66e0152d164f2aebd20efb0593ceec
This patch renames element.fromJson and element.toJson to
evaluate.fromJSON and evaluate.toJSON, respectively.
The JSON (de)serialisation code belongs more naturally in the evaluate
module, which did not exist when these functions were written.
MozReview-Commit-ID: FJGbjGD1kZ6
--HG--
extra : rebase_source : b2528f545c8213b06b9116299806d8ab8a875250
By using the page load strategy each navigation request has to return
when the page load has reached the expected document ready state, or
immediately if a strategy of "none" is set.
This also removes the page load checks when switching frames because
this is not part of the webdriver spec.
MozReview-Commit-ID: 3KbsDvzEG6c
--HG--
extra : rebase_source : 68170235424e181c083febd44fca6bb0c5dfec63
In cases when the navigation trigger function returns too late and the
beforeunload event has already been fired, the page load currently gets
canceled. This happens because the page unload timer hasn't been set at
this time and the unbeforeunload handler doesn't extend its time.
With this patch a flag is used which indicates if an beforeunload
event already occurred, so when the pageunload timer notifies the page
listener the unload timer can be extended to 5s as expected.
MozReview-Commit-ID: FKK0oGEWijU
--HG--
extra : rebase_source : bf4342cfb439eb85cb87cad922054953e5cb97f3
Using only the different unload events to detect a page load is
unreliable because of a possible delay in starting the navigation,
which could be triggered by a slowness of the application.
By using 'beforeunload', an event will be received much earlier,
and the unload timer can be extended to a couple more seconds to
wait for the navigation request to start.
If a website has it's own 'beforeunload' listener registered,
a tab modal dialog will be opened by Firefox, and Marionette
returns from the currently active command immediately to allow
the test to handle the dialog.
MozReview-Commit-ID: 6ZUYtFJSSnz
--HG--
extra : rebase_source : 3f7b9d9d0067ed7c65a3bb8774f0a5ae8bc702c2
Similar to the other unload and load events during a page load,
the hashchange event should only be handled if the event's target
document is the current window.
MozReview-Commit-ID: F1LMBh5Cy4A
--HG--
extra : rebase_source : 668fd6946067989e7e732b24baf6de2e85541f21
originalTarget seems to be outdated and not used anymore for each
navigation related event. But target is, and as such handleEvent
has to make use of that instead.
MozReview-Commit-ID: AN2H1PbCt7A
--HG--
extra : rebase_source : fbead2b5b802454f0e288fb9696db5d422e46b50
With remoteness enabled content framescripts don't seem to inherit the
appenders for loggers, which have been set by the main script. To get
the output written to stdout they have to add their own appender. To
prevent duplicated output after framescripts get reloaded, the addition
of the appender should only happen once.
MozReview-Commit-ID: A5TMQvQu0Iy
--HG--
extra : rebase_source : 9a9ecdb8aec8d7b310b916407edbac77b8ec88c9
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.
MozReview-Commit-ID: DWV53sckBS2
--HG--
extra : rebase_source : 1b7905c101b7ebf406e88c73be5d0e069b7342c0
In the case when the trigger callback inside navigate() uses a generator,
the code has to be synchronized and needs to wait until the contained
command has been completed.
MozReview-Commit-ID: 8qKUMvH7HpS
--HG--
extra : rebase_source : 19a87058d62088701914ab2a468ddffaecec1fe2
In the case of switching to an in-process frame, the checkLoad timer
is setup which waits for the frame's content to finish loading.
But the command doesn't actually wait for those events and calls
sendResponse() immediately. This causes a race condition for the
following commands.
MozReview-Commit-ID: 6vuQ7paQ55K
--HG--
extra : rebase_source : ceb590f435d84ead4eba2e718e1ebaa01900d33f
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.
MozReview-Commit-ID: DWV53sckBS2
--HG--
extra : rebase_source : 455e252e85c14b4ca841f02794bf0d33133ef10a
In the case when the trigger callback inside navigate() uses a generator,
the code has to be synchronized and needs to wait until the contained
command has been completed.
MozReview-Commit-ID: 8qKUMvH7HpS
--HG--
extra : rebase_source : 19a87058d62088701914ab2a468ddffaecec1fe2
In the case of switching to an in-process frame, the checkLoad timer
is setup which waits for the frame's content to finish loading.
But the command doesn't actually wait for those events and calls
sendResponse() immediately. This causes a race condition for the
following commands.
MozReview-Commit-ID: 6vuQ7paQ55K
--HG--
extra : rebase_source : ceb590f435d84ead4eba2e718e1ebaa01900d33f