Commit Graph

375 Commits

Author SHA1 Message Date
David Burns
c4d8c565b3 Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : be2b8b6da5cf78c6263502a6cb422e2de81c742d
2017-05-22 21:54:26 +01:00
Sebastian Hengst
e399d29e1d Backed out changeset 8cc336b9806d (bug 1364594) for almost permafailing Marionette-headless in either test_window_maximize.py TestWindowMaximize.test_maximize or test_window_rect.py TestSize.test_resize_while_fullscreen. r=backout 2017-05-23 13:26:27 +02:00
David Burns
8a1ed5912e Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : be2b8b6da5cf78c6263502a6cb422e2de81c742d
2017-05-22 21:54:26 +01:00
Sebastian Hengst
88f80f3cdf Backed out changeset 515c3f15cf30 (bug 1364594) for failing test_window_maximize.py TestWindowMaximize.test_maximize on Linux. r=backout 2017-05-18 23:38:30 +02:00
David Burns
8e371b7fb3 Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : 8502233bc79452df4755dea08b04ab6423cf91ed
2017-05-18 09:23:08 +01:00
Sebastian Hengst
d9fe1a9412 Backed out changeset d58fda39820b (bug 1364594) for failing Marionette's test_window_maximize.py TestWindowMaximize.test_maximize on Windows 8 x64. r=backout 2017-05-17 17:54:47 +02:00
David Burns
a83b408222 Bug 1364594: Exit fullscreen when Set Window Rect is invoked. r=ato
If the browser is in fullscreen mode and Set Window Rect is called
we need to exit fullscreen mode and then continue to manipulate the
browser.

As described in https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect
Step 10

MozReview-Commit-ID: 5ixhGOXVBE4

--HG--
extra : rebase_source : 984fd3f38c45cbbb1eaae35bd6dea17842bbc6a3
2017-05-16 12:38:11 +01:00
Andreas Tolfsen
a9505b4395 Bug 1363053 - Move element.fromJson/toJson to evaluate module r=maja_zf
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
2017-05-08 17:05:20 +01:00
Henrik Skupin
7d15bba78b Bug 1318351 - Remove mainContent and related code used by B2G. r=ato
MozReview-Commit-ID: 1BZY5VvCMZ9

--HG--
extra : rebase_source : f306e0509b2403496dd60fa19ca28abe2e198cdb
2017-05-04 11:45:08 +02:00
Henrik Skupin
2ef12d4a3e Bug 1318351 - Ensure that window ids are internally handled as numbers. r=ato
Right now we retrieve window handles at different locations and as
such those are sometimes numbers but also strings. Given that we have
strict comparisons when checking for the id, checks can fail.

The patch also ensures that both close() and closeChromeWindow()
methods are returning the window ids as string.

MozReview-Commit-ID: ImOLe0Z2OE1

--HG--
extra : rebase_source : fe6e7857def2fde4e8253b1bfef8dd2a7d6bd954
2017-05-09 10:25:26 +02:00
David Burns
2b14993449 Bug 1189749: Implement full screen support in Marionette r=ato
This implements the Full Screen method described in the WebDriver specification
(http://w3c.github.io/webdriver/webdriver-spec.html#fullscreen-window) as well as
tests for it.

MozReview-Commit-ID: GKec7GNE6rm

--HG--
extra : rebase_source : 92d427b40d6aeb760783e67d4796a56bb0dbc6cb
2017-05-08 16:41:35 +01:00
Henrik Skupin
2c6b09cf46 Bug 1362528 - Let getWindowHandles and getChromeWindowHandles return list of strings r=ato
By the webdriver spec both commands have to return a list of strings for the
window handles. Right now those are numbers.

MozReview-Commit-ID: 5Gn624BaVI1

--HG--
extra : rebase_source : 400acb7a0cc4bc1b1bf09934959a63da1bb5a28c
2017-05-05 22:21:51 +02:00
David Burns
7d9e71c048 Bug 1361987 - Move setWindowRect to not return from a generator. r=ato
setWindowRect is using `return` from a generator which is not valid
javascript. This now populates the response before it is returned to
the client.

MozReview-Commit-ID: 6vSadp59Nrt

--HG--
extra : rebase_source : d642771dd2308c21d1e3398b7387b4ae4e5ffeea
2017-05-05 20:29:04 +01:00
David Burns
eda4f81db7 Bug 1361987 - Move maximizeWindow call to not use a return in a generator. r=ato
The maximizeWindow call in Marionette uses return which is not valid javascript.
This change update the response that is then picked up by the server before
returning to the remote end.

MozReview-Commit-ID: JJzsTHba0AK

--HG--
extra : rebase_source : 8b64aa37c7391d60a9de3276cef89a5564bbcd37
2017-05-05 14:49:41 +01:00
Andreas Tolfsen
632deccd67 Bug 1357878 - Maximize window synchronously and restore when maximized; r=maja_zf
When refactoring the tests for the Set Window Rect command, it was
discovered that the Maximize Window command was not synchronous.

This patch makes GeckoDriver#maximizeWindow synchronous by waiting for
the DOM resize event to fire before returning the window rect to the user.

It also aligns the command with the WebDriver standard by making it
restore the window to its original size when calling the command a
second time.

MozReview-Commit-ID: Ft3tn2A4m7u

--HG--
extra : rebase_source : 52b523e53dd19cc8bdc4631382c96db5906f333a
2017-04-20 17:04:58 +01:00
Andreas Tolfsen
5bd3bf699c Bug 1357878 - Prevent hang on setting window size to existing size; r=maja_zf
When the window's size is being set to the window's existing size,
Marionette unconditionally listens for the DOM resize event.  When a
window is not resized, no such event fires.

This patch skips setting the window size when the window's current size
is the requested size.  This bypasses the problem of listening for an
event that never occurs.

It also combines the window position- and size tests into a
test_window_rect.py test, since they share many of the same
characteristics.

Fixes: https://github.com/mozilla/geckodriver/issues/643
MozReview-Commit-ID: IUtCFXwT1fh

--HG--
extra : rebase_source : 43c4d0e24cf1e0dc6102af48b8fe6f075b6dd4a2
2017-04-19 21:19:36 +01:00
Henrik Skupin
247b5f9899 Bug 1335778 - Make element click command check for page load and wait. r=ato
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
2017-04-20 12:12:27 +02:00
Sebastian Hengst
2bb5df4de7 Backed out changeset e084deb550c2 (bug 1335778) 2017-04-26 14:12:13 +02:00
Henrik Skupin
d9653a7941 Bug 1335778 - Make element click command check for page load and wait. r=ato
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
2017-04-20 12:12:27 +02:00
Andreas Tolfsen
9d9b0dba43 Bug 1359004 - Add preliminary support for unexpected alerts r=whimboo
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
2017-04-20 18:00:46 +01:00
Sebastian Hengst
b1985f3e25 Backed out changeset 938d57f025ea (bug 1335778)
MozReview-Commit-ID: 1PODrjHutgJ
2017-04-19 18:53:32 +02:00
Henrik Skupin
f1d53ae011 Bug 1335778 - Make element click command check for page load and wait. r=ato
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 : 2c4d2a19a006645ecd44e08a28309367bf4f8d32
2017-04-13 20:16:23 +02:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Andreas Tolfsen
ab9085d475 Bug 1354323 - Accept string text for sendKeysToDialog command; r=automatedtester
As a follow-up to https://bugzilla.mozilla.org/show_bug.cgi?id=1354323,
this makes the Marionette sendKeysToDialog command take a text field
with a string, instead of the value field with an array of strings.

The relevant WebDriver specification change is
https://github.com/w3c/webdriver/pull/889.

Fixes: https://github.com/mozilla/geckodriver/issues/607

MozReview-Commit-ID: AY52pAK2582

--HG--
extra : rebase_source : f767ae09e5f415e6e944ececfb83c442f23407f3
2017-04-06 23:37:04 +01:00
Henrik Skupin
3055f8532d Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : 1fd914aec1c55fe91a0de773cfd7ff22b5d12167
2017-03-27 16:16:36 +02:00
Henrik Skupin
bdc3b68d5c Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 40f90e3b9d1bf0a2f9123271cd08513769616e41
2017-03-28 21:41:38 +02:00
Henrik Skupin
8b95b9033d Bug 1348872 - Check for existent modal dialogs for new Marionette sessions. r=ato
To ensure that Marionette can also detect modal dialogs opened right after
the application starts, and before Marionette has been initialized, the modal
dialog detection code has to be delayed until a new session actually gets
started. Then it's not enough to only register the observer notification, but
it should also be checked for open modal or tab modal dialogs.

MozReview-Commit-ID: ChYcR3I59DW

--HG--
extra : rebase_source : 68f13620a41d0535f96abe4d1b25d41a6b428120
2017-03-28 22:47:57 +02:00
Henrik Skupin
5a77c8145b Bug 1348872 - Add contentBrowser property to browser's Context class. r=ato
Make it easier to access the content browser for the currently selected
tab by not requiring to go through the global getBrowserForTab() method.

MozReview-Commit-ID: 3zdCGJFanto

--HG--
extra : rebase_source : b49417ab7d03a50ce40b71e8478c66cdfcda0aa6
2017-03-27 11:02:36 +02:00
Sebastian Hengst
808ec675be Backed out changeset cf7d24fe5cec (bug 1291320) 2017-03-29 00:30:56 +02:00
Sebastian Hengst
9313f64ed7 Backed out changeset dba85e8288af (bug 1291320) 2017-03-29 00:30:51 +02:00
Henrik Skupin
66f4253300 Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : afb2bd3f10fd08b6eff85f7583d2cbb535f4f154
2017-03-27 16:16:36 +02:00
Henrik Skupin
51a98f5c1b Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 1216be48a23f8841fe1b12873e6154480ace125a
2017-03-28 21:41:38 +02:00
David Burns
acf4662f21 Bug 1347589: Implement Marionette Get Window Rect. r=ato
Brings the getWindowPosition and getWindowSize calls into
one call. This aligns Marionette with the W3C WebDriver call
`Get Window Rect`.

MozReview-Commit-ID: ItWI6YpCJkx

--HG--
extra : rebase_source : c08daa9ba0a31a2f2082a7d460619e817180bf22
2017-03-24 13:54:37 +00:00
David Burns
54c2a05c8d Bug 1347589: Implementation of Marionette Set Window Rect. r=ato
This implements Set Window Rect from the W3C WebDriver specification
to allow us to change the size and position of a window in one call

MozReview-Commit-ID: KxwJyyjg1VU

--HG--
extra : rebase_source : e2f32e4c674847b336c5eeb772d24fff595e2075
2017-03-24 14:35:38 +00:00
David Burns
7e5554522e Bug 1348782: Updated expected key parameter for sendKeysToElement. r=ato
The expected command parameter has been updated from `value`
to `text`. This aligns marionette with W3C WebDriver
Send Keys To Element command.

MozReview-Commit-ID: EkQ1UJ58V7f

--HG--
extra : rebase_source : 1706113816eb4184334330e237e07c1f480d4500
2017-03-24 21:37:43 +00:00
Andreas Tolfsen
d594cb5ef8 Bug 1337743 - Rename quitApplication command quit; r=whimboo
This shortens the name of the quitApplication Marionette command to
`quit'.

The client is not updated since it is used for Firefox upgrade tests.
It can be updated to use `quit' when Firefox 56 ships.

MozReview-Commit-ID: Gq5KWMS1AzF

--HG--
extra : rebase_source : dfaf557f658595bfa5b8d1d294d6d6525f5d2abf
2017-03-27 12:53:27 +01:00
Andreas Tolfsen
9bfbf4c96b Bug 1337743 - Return cause of quit; r=whimboo
This adds a return type to the quitApplication command in Marionette,
which extracts the data received by the quit-application observer.
The returned cause is either "shutdown" or "restart".

MozReview-Commit-ID: 85fBGaS1VeQ

--HG--
extra : rebase_source : f96409b772a2c30e755b5a28b6e4eef1dcfb2654
2017-03-27 12:49:22 +01:00
Andreas Tolfsen
601e23ab3b Bug 1337743 - Stop appending eAttemptQuit in quitApplication; r=jgraham,whimboo
Change Marionette's quitApplication command to accept an optional array
of masks for Services.startup.quit.  If no masks are provided or the flags
field is not provided, we assume nsIAppInfo.eAttemptQuit as the default.

This deviates from the current behaviour whereby eAttemptQuit is
unconditionally included when passed an array of flags.  This is
problematic because Services.startup.quit does not allow combinations
of *Quit flags, e.g. eAttemptQuit and eForceQuit cannot be combined.

MozReview-Commit-ID: FVqdaXFA4aC

--HG--
extra : rebase_source : 10074c53294a6596ecbd09a3f6ec477f3f8ed452
2017-02-09 18:35:00 +00:00
Carsten "Tomcat" Book
b74a02d6b7 Backed out changeset 3f619577e5d7 (bug 1291320) 2017-03-27 12:01:49 +02:00
Carsten "Tomcat" Book
9b4bc03f6b Backed out changeset 8580c2a3629e (bug 1291320) 2017-03-27 12:01:47 +02:00
Henrik Skupin
c64b04d4ae Bug 1291320 - Make refresh command synchronous. r=ato,automatedtester
Update the refresh command to make it synchronous, and let it return
once the target page has been loaded. This can be accomplished by using
the loadListener object in listener.js.

MozReview-Commit-ID: Lc8QoGFeQrY

--HG--
extra : rebase_source : f5aa7a9a6d144b849b2808b08d78ca99fc83e518
2017-03-14 18:10:00 +01:00
Henrik Skupin
6df67da555 Bug 1291320 - Refactor page load algorithm for listener framescript. r=ato,automatedtester
This refactoring allows us to re-use the same load algorithm for
each command which could trigger a page load. It also takes remoteness
changes into account, and waits until the load has been done.

With this change we no longer check for readyState only, but observe
the necessary DOM events as fired for page unloads and loads. This will
help us to implement the page loading strategy later.

By observing the DOM events, I also expect a small increase of performance
for any kind of page load, given that we now return immediately and do not
have a delay of 100ms at maximum.

MozReview-Commit-ID: IVtO6KgJFES

--HG--
extra : rebase_source : 7cce694d464a18773c65056c336b9f900f5466d0
2017-03-23 21:54:02 +01:00
Carsten "Tomcat" Book
332688962a Merge mozilla-central to mozilla-inbound
--HG--
rename : testing/web-platform/tests/storage/interfaces.html => testing/web-platform/tests/storage/interfaces.https.html
2017-03-23 13:57:16 +01:00
Andreas Tolfsen
7fbc7c7a97 Bug 1333014 - Align element interaction errors with spec; r=whimboo
This renames the ElementNotVisibleError to ElementNotInteractableError,
and adds a new ElementClickInterceptedError.

MozReview-Commit-ID: 6cjVghUCvyv

--HG--
extra : rebase_source : 3f2105c1f631ac4776e231bb6c88a00e26f1ae6c
2017-02-03 19:30:13 +00:00
Henrik Skupin
9e2c084d72 Bug 1322383 - getCurrentWindow() has to only return the currently selected window. r=ato,maja_zf
Given that this method will be used in each command for checks of a valid window, we have to return
the currently active window. It means the window mediator should only be used during setting up the
session to find the first browser window.

At the same time the code in this method is getting split-up for chrome and content scopes.

MozReview-Commit-ID: KyzxYk63RgA

--HG--
extra : rebase_source : d7e79bedd4d414975f7dec91a19a1ad73d16c725
2017-03-20 22:43:32 +01:00
Henrik Skupin
9b63422f73 Bug 1322383 - Add missing checks for valid chrome window. r=ato
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
2017-03-20 15:13:32 +01:00
Andrea Marchesini
ce13019950 Bug 1344957 - Enabling File.createFromNsIFile and File.createFromFileName only for testing and file-content-process, r=ehsan, r=bobowen 2017-03-21 11:11:06 +01:00
Andrea Marchesini
aa6eb8aa9c Bug 1349859 - Enabling DOM File creation in content process for marionette tests, r=ato 2017-03-23 11:26:29 +01:00