Граф коммитов

31481 Коммитов

Автор SHA1 Сообщение Дата
Botond Ballo 8466c5994a Bug 1786974 - Avoid PanZoomControllerTest#scrollToVerticalOnZoomedContent{Smooth,Auto} failure due to rounding. r=hiro,geckoview-reviewers,owlish
window.innerHeight is rounded to integer because of dom.innerSize.rounded=true,
so the quantity being compared to it needs to be rounded as well.

Differential Revision: https://phabricator.services.mozilla.com/D155519
2022-08-25 01:25:25 +00:00
Luca Greco 9efa813720 Bug 1760608 - Restrict MV2 pageAction/browserAction setPopup to same extension urls on GeckoView. r=mixedpuppy,geckoview-reviewers,owlish
This patch extends restricts setPopup to extension url to MV2 extensions running on GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D154549
2022-08-23 10:35:58 +00:00
Luca Greco 28400cd40e Bug 1760608 - Fix and reenable GeckoView ExtensionActionTest.testOpenPopup. r=geckoview-reviewers,ohall
This patch fixes a pre-existing "setPopup + openPopup" GeckoView test case that was apparently disable
because it was failing intermittently.

While trying to run it locally I noticed that the test was getting stuck because there is no
tab delegate that would be allowing the test extension to update the current tab from
http://example.com to the extension page that was meant to be triggering the openPopup API call.

Loading the extension page using mainSession.loadUrl seems to be making the test able to fully
run and pass.

It is possible that the test case was originally working but got broken while it started to be ignored,
the test was missing to await for the setPopup call to be fully handled and that may have been likele
a source of intermittent failures over a larger number of runs.

Differential Revision: https://phabricator.services.mozilla.com/D154548
2022-08-23 10:35:58 +00:00
Emilio Cobos Álvarez c20ec755c9 Bug 1782751 - Make desktop viewport mode a synced BrowsingContext field. r=twisniewski
So that it's preserved properly across replacements (bug 1781936).

Differential Revision: https://phabricator.services.mozilla.com/D155274
2022-08-22 22:12:07 +00:00
Olivia Hall 4a2c220e7c Bug 1780557 - High Rate Sensor Android Permission r=geckoview-reviewers,calu
Beginning in Android 12, apps needing to use high sensor rates need to
have the HIGH_SAMPLING_RATE_SENSORS permission requested.

Differential Revision: https://phabricator.services.mozilla.com/D155238
2022-08-22 17:57:39 +00:00
Jamie Nicol 88814ceb27 Bug 1783542 - Temporarily stop toggling SurfaceControl usage. r=geckoview-reviewers,calu
In bug 1780093 we discovered that our usage of the SurfaceControl
compositing path was preventing the text selection magnifier from
working. We attempted to toggle the SurfaceControl compositing path
off when the magnifier was active, however this has caused much more
severe issues with rendering content at the wrong size after the
keyboard has been dismissed.

For now, stop toggling SurfaceControl usage until we have found out
how to do so without rendering at the wrong size. This will mean the
magnifier will once again not work.

Differential Revision: https://phabricator.services.mozilla.com/D155202
2022-08-22 17:44:41 +00:00
Olivia Hall 8454981589 Bug 1771012 - GeckoView Open Tabs Test Utility r=geckoview-reviewers,owlish
Adds event "GeckoView:Test:NewTab”, which allow testers to create tabs.

`GeckoViewTestUtils.jsm` sends the event from the JavaScript side for
use in testing.

A `ServiceWorkerDelegate` is required to be set for the
`GeckoRuntime` to use these events, which was setup on the test
runner.

Differential Revision: https://phabricator.services.mozilla.com/D152891
2022-08-22 14:44:38 +00:00
Sylvestre Ledru 128c74caac Bug 1785451 - Ride along: Fix some typos r=linter-reviewers,fluent-reviewers,geckoview-reviewers,extension-reviewers,keeler,rpl,calu,ahal,flod DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D154946
2022-08-18 07:29:08 +00:00
Botond Ballo cd56c8b9ae Bug 1746336 - Add a new geckoview-junit test. r=hiro,geckoview-reviewers,calu
Depends on D152351

Differential Revision: https://phabricator.services.mozilla.com/D152352
2022-08-18 02:15:39 +00:00
Botond Ballo 65a722e6e1 Bug 1746336 - Treat nsEventStatus_eIgnore as INPUT_RESULT_UNHANDLED consistently. r=hiro,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D152351
2022-08-18 02:07:14 +00:00
Ryan VanderMeulen b99ba1c11c Bug 1785302 - Fix GeckoView gradle warnings. r=geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D154927
2022-08-17 22:04:29 +00:00
Agi Sferro cd000ebc03 Bug 1648158 - Store SHIP (Session History in Parent Process) support on Android. r=geckoview-reviewers,owlish
Instead of using SessionStateAggregator.js send() to collect history data and send the event StateUpdated to the app, the new GeckoViewSessionStore is used. It is enabled when fission is true and initialized by GeckoViewStartup when Services.appinfo.sessionHistoryInParent is true. It will observe two existing topics: browsing-context-did-set-embedder, which creates the history listener, and browsing-context-discarded, which unregisters it. When the history listener is created, it will collect history from the parent. It will only collect data when the current uri is not “about:blank” and when the history count is greater than 0. It uses SessionHistory’s collectFromParent.

The new code path was manually confirmed by debugging the app history delegate to see that the state map contains all the history data.

Differential Revision: https://phabricator.services.mozilla.com/D150020
2022-08-17 17:03:27 +00:00
Makoto Kato a2a31e8702 Bug 1783804 - Use std::move for InputData since copy constructor of InputData doesn't copy all member variable. r=geckoview-reviewers,calu
When turning on fission, OOP child frame doesn't receive touch events such as
`touchstart`.

When dispatching touch event from GeckoView side, some informations such as
`mLayersId` are missing since copy constructor of `MultiTouchInput` doesn't
copy all information.

Since the structure of Input data has a lot of members, we should use
`std::move` instead of copy constructor of `InputData`. It can avoid
unnecessary copy.

Differential Revision: https://phabricator.services.mozilla.com/D154242
2022-08-15 08:47:35 +00:00
Sylvestre Ledru 8a829cb5fa Bug 1783917 - geckoview doc: Remove references to arc r=geckoview-reviewers,calu DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D154120
2022-08-10 15:54:42 +00:00
Jamie Nicol 8f3214f02a Bug 1783542 - Disable SurfaceControl only when magnifier is active. r=geckoview-reviewers,owlish
Rather than when a selection is active. Originally we chose to disable
SurfaceControl whenever a selection was active, as it is then likely
the magnifiers may be shown soon, but it reduced the amount of times
we switch between SurfaceControl being enabled and disabled when the
selection is frequently modified.

However, that has 2 issues: First, the magnifier can be shown when
dragging a single caret in a form, rather than just when a selection
is active. With the original fix, the magnifier did not work in this
case. And second, we encountered a bug when the widget is resized at
the same time as SurfaceControl is toggled, where we end up rendering
the page at the wrong size.

This patch therefore makes us only disable SurfaceControl when the
magnifier is actually being shown. This may cause us to enable or
disable it more frequently, but that doesn't appear to be a big deal.

Differential Revision: https://phabricator.services.mozilla.com/D154086
2022-08-09 18:50:41 +00:00
Kagami Sascha Rosylight 16ea24f6cc Bug 1769290 - Part 26: Emit errors from JSHandleRootedTypedefChecker r=andi,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D151842
2022-08-09 14:13:30 +00:00
Rob Wu 7e7534ced4 Bug 1780747 - Register DNR schema and permissions r=rpl,geckoview-reviewers,owlish,flod
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.

Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).

Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).

Differential Revision: https://phabricator.services.mozilla.com/D152503
2022-08-09 12:16:34 +00:00
Cristian Tuns a96814126e Backed out 2 changesets (bug 1780747) for causing xpcshell failures on test_ext_permission_warnings.js CLOSED TREE
Backed out changeset be950e847c33 (bug 1780747)
Backed out changeset b07c7315a02a (bug 1780747)
2022-08-08 19:04:56 -04:00
Rob Wu f8ed240ae5 Bug 1780747 - Register DNR schema and permissions r=rpl,geckoview-reviewers,owlish,flod
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.

Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).

Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).

Differential Revision: https://phabricator.services.mozilla.com/D152503
2022-08-08 22:11:08 +00:00
Jamie Nicol 0725e618c9 Bug 1783244 - Ensure JNI is ready before calling isSurfaceAbandoned. r=geckoview-reviewers,m_kato
In bug 1772839 we added a check for whether a Surface is in an
abandoned state prior to resuming the compositor. This check requires
calling a native function via JNI, however, this may be called before
gecko has reached the JNI_READY state. Calling this function then
results in crashes due to UnsatisfiedLinkError exceptions.

To fix this, check whether the gecko state is at least JNI_READY prior
to calling the native function. If JNI is not yet ready, we just have
to assume that the Surface is in a valid state, which may cause us to
crash if that is not actually the case. But that should be a rare
occurrence, and is certainly preferable to always crashing due to
the UnsatisfiedLinkError.

Differential Revision: https://phabricator.services.mozilla.com/D153935
2022-08-08 15:09:26 +00:00
Olivia Hall fce7810bef Bug 1782729 - GeckoViewNavigation should check for supported principals r=geckoview-reviewers,permissions-reviewers,pbz,calu
GeckoViewNavigation.jsm's `onLocationChange` should check that the principal
to get permissions for is a supported principal.

Differential Revision: https://phabricator.services.mozilla.com/D153527
2022-08-04 19:36:10 +00:00
Jamie Nicol a17ddfc210 Bug 1780093 - Disable SurfaceControl compositing path when selection is active. r=geckoview-reviewers,calu
On Android we previously added a rendering path using the
SurfaceControl API, in order to work around an Android OS bug when
recovering from a GPU process crash. Unfortunately the Magnifier
widget (shown when moving a text selection caret) does not work when
rendering using SurfaceControl.

This patch makes it so that we temporarily disable the SurfaceControl
path when a text selection is active, allowing the Magnifier to work.
Unfortunately this means that if a GPU process crash occurs while
there is an active selection we will be unable to recover. Hopefully
this turns out to be a relatively rare occurence.

Differential Revision: https://phabricator.services.mozilla.com/D153454
2022-08-02 20:55:20 +00:00
Shane Caraveo d08731448a Bug 1711168 allow extension pages to be loaded as top level tabs by other extensions r=rpl,geckoview-reviewers,calu
Ensure extensions can manage tabs and sessions that include tabs from other extensions.  The parent
patch to this introduces cross-extension access validation.  However that breaks this specific use case
that we need to continue supporting.  This patch modifies three extension apis, tab.create/update and
windows.create to allow the creation of extension tabs which cannot be otherwise accessed.

Differential Revision: https://phabricator.services.mozilla.com/D151766
2022-08-02 17:08:58 +00:00
Olivia Hall 3c00feeae1 Bug 1710943 - Enable NavigationDelegate Isolated Process Tests r=geckoview-reviewers,calu
Issue originally causing tests to fail has not repeated.

Differential Revision: https://phabricator.services.mozilla.com/D153278
2022-08-01 13:52:04 +00:00
Makoto Kato e6d0758441 Bug 1769742 - Don't affect TimeoutMillis annotation to test clean up. r=geckoview-reviewers,calu
Actually, default timeout of geckoview junit is 3000ms, but we can change it
by `@TimeoutMillis`.

When changing timeout value, the timeout of clean up function such as
`cleanupExtensions` is also changed. So if `@TimeoutMillis` is small, cleanup
may be failed due to timeout.

So we shouldn't apply `@TimeoutMillis` on clean up. I guess bug 1606702 and bug
1607631 are same root cause too.

Differential Revision: https://phabricator.services.mozilla.com/D153123
2022-08-01 02:46:01 +00:00
Daisuke Akatsuka fe1785170f Bug 1776609: Record source and triggeringPlaceId for sponsored tile on newtab. r=mak,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D150729
2022-08-01 00:27:50 +00:00
Butkovits Atila 665e518c7f Backed out 2 changesets (bug 1776609) for causing failures at browser_topsites_annotation.js. CLOSED TREE
Backed out changeset cac795fd16d2 (bug 1776609)
Backed out changeset 88ec1cca8540 (bug 1776609)
2022-08-01 00:52:35 +03:00
Daisuke Akatsuka 971ff4bfb6 Bug 1776609: Record source and triggeringPlaceId for sponsored tile on newtab. r=mak,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D150729
2022-07-31 20:26:30 +00:00
Butkovits Atila 900cbd85bd Backed out 2 changesets (bug 1776609) for causing gtest failures. CLOSED TREE
Backed out changeset 7630fea97777 (bug 1776609)
Backed out changeset 426cbe0fac73 (bug 1776609)
2022-07-29 13:42:33 +03:00
Daisuke Akatsuka 7c02dae76f Bug 1776609: Record source and triggeringPlaceId for sponsored tile on newtab. r=mak,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D150729
2022-07-29 09:24:28 +00:00
Cathy Lu 08d4e80f75 Bug 1781180 Remove deprecated autofill calls r=geckoview-reviewers,jonalmeida,ohall
Differential Revision: https://phabricator.services.mozilla.com/D152805
2022-07-29 04:57:34 +00:00
ahochheiden 3dd666e072 Bug 1777132 = Update bootstrapping instructions in GeckoView Contributor Quick Start Guide r=geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D152459
2022-07-28 22:31:38 +00:00
Ryan VanderMeulen 7458cb1257 Bug 1773103 - Remove the unused findhelper.autozoom pref. r=geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152925
2022-07-28 00:32:55 +00:00
Ryan VanderMeulen d22a40b4fd Bug 1773062 - Remove the unused direct-texture.force.disabled and direct-texture.force.enabled prefs. r=geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D152924
2022-07-28 00:32:55 +00:00
Makoto Kato 2ed3d6c0ec Bug 1769742 - evaluateJS_canTimeout shouldn't use alert(). r=geckoview-reviewers,calu
Actually, `evaluateJS_canTimeout` test uses `alert()` to time out.

But when this test is failure, alert prompt is closed by calling reject
callback during timed out. Then, gv-junit cannot detect `TimeoutException`.
Since this reject callback is called by `nsIAndroidEventFinalizer`, I think
that using alert isn't good for `evaluateJS_canTimeout`.

So I would like to use other way instead of something prompt.

Differential Revision: https://phabricator.services.mozilla.com/D152751
2022-07-27 02:06:01 +00:00
Butkovits Atila 3204f22c53 Backed out changeset ee018d31dbfc (bug 1781180) for causing failures geckoview failures. CLOSED TREE 2022-07-27 02:53:25 +03:00
Cathy Lu 0ffa02f2a2 Bug 1781180 Remove deprecated autofill calls r=geckoview-reviewers,jonalmeida,ohall
Differential Revision: https://phabricator.services.mozilla.com/D152805
2022-07-26 22:59:23 +00:00
Tooru Fujisawa 2c15cdbe26 Bug 1780543 - Part 8: Remove unused eslint rule. r=Standard8,geckoview-reviewers,calu
Depends on D152432

Differential Revision: https://phabricator.services.mozilla.com/D152646
2022-07-26 02:46:31 +00:00
Tooru Fujisawa a6aabba5a4 Bug 1780543 - Part 1: Use eslint-env mozilla/frame-script consistently in frame script. r=Standard8,webdriver-reviewers,geckoview-reviewers,jdescottes,calu
Differential Revision: https://phabricator.services.mozilla.com/D152426
2022-07-26 02:46:28 +00:00
Dan Robertson 145bfbb928 Bug 1769292 - Fix broken links in mozilla central quickstart. r=agi
Fix some broken links in the mozilla central quickstart doc.

Differential Revision: https://phabricator.services.mozilla.com/D146331
2022-07-22 12:42:13 +00:00
Jamie Nicol 86e2a29705 Bug 1780377 - Add documentation for using Android Studio's native memory profiler with GeckoView. r=geckoview-reviewers,calu DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D152273
2022-07-21 08:18:31 +00:00
Pranshu Agrawal 940e4d8d1e Bug 1756530 : Removed Workaround of Bug1707959. r=m_kato,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151991
2022-07-21 07:59:48 +00:00
Ting-Yu Lin b4c04f0197 Bug 1779269 - Fix AccessibleCaret's display on disabled form controls. r=emilio,webdriver-reviewers,whimboo,geckoview-reviewers,m_kato
A disabled form controls cannot be focused, and its frame selection is different
from the one for not-editable content. Use GetLastFocusedFrameSelection() (added
in Bug 253870) to get the correct frame selection that is visible to the user.

Add some basic tests for disabled <textarea> such as long pressing to select,
dragging, etc. They should behave the same as normal <textarea>.

Differential Revision: https://phabricator.services.mozilla.com/D151800
2022-07-21 05:44:30 +00:00
Olivia Hall 532663c44b Bug 1763466 - Change how is24HourFormat is determined for Isolated Process r=geckoview-reviewers,owlish
Android's `is24HourFormat` could not be be called from GeckoAppShell
when using isolated process. Changed GeckoAppShell's `getIs24HourFormat`
to be set as a variable in GeckoRuntime, which has correct access to
`is24HourFormat`.

Differential Revision: https://phabricator.services.mozilla.com/D152132
2022-07-19 21:48:02 +00:00
Makoto Kato 142a78ca7c Bug 1763954 - Add a small wait to finish `nsDocumentViewer::PermitUnload` loop. r=geckoview-reviewers,calu
`onBeforeUnloadTest` may be failure when `beforeunload` is immediately called
again.

Although 1st prompt by `beforeunload` is closed in test, Gecko may be clear
the flag (`nsDocumentViewer::mInPermitUnloadPrompt`) for prompt state at this
time. Then, if 2nd `beforeunload` is fired immediately, since the flag
isn't clear, `nsDocumentViewer` recognizes that `beforeunload` prompt is still
opened. Then newer prompt isn't called.

So we need a wait to clear this flag.

Differential Revision: https://phabricator.services.mozilla.com/D151903
2022-07-19 01:49:51 +00:00
Cathy Lu df9bafbf73 Bug 1734394 - Make Geckoview use the session store collector r=geckoview-reviewers,agi,farre,peterv
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.

Differential Revision: https://phabricator.services.mozilla.com/D148215
2022-07-15 20:44:55 +00:00
Pranshu Agrawal a16a2f2cd1 Bug 1510647 Lint Warning: Missing @IntDef in Switch. r=m_kato,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151653
2022-07-15 01:20:26 +00:00
Makoto Kato c69c9f0882 Bug 1763570 - Wait for APZ state to set autofill information. r=geckoview-reviewers,owlish
When setting focus to input element, Gecko sets focused element to central via
`zoomToFocusedInput`. So when we receives `focusin` event, content may be
scrolled and zoomed. To pass correct element rectangle, we have to wait until
it is completed.

Fennec added `PanZoom:StateChange` event to listen APZ state. So GV should use
same way.

Differential Revision: https://phabricator.services.mozilla.com/D150453
2022-07-14 18:32:47 +00:00
Jamie Nicol d40ea70ccc Bug 1772839 - Work around compositor being resumed with abandoned Surfaces. r=geckoview-reviewers,owlish
On some Android devices (predominantly Huawei devices running Android
9 or below) we are seeing large numbers of crashes due to the
compositor being unable to create an EGL surface to render in to. From
local testing, this appears to be due to the Surface we are being
provided from the SurfaceView being in an "abandoned"
state. Presumably this is due to an operating system bug - the Surface
is valid at the time of the surfaceChanged() callback, but becomes
abandoned moments later despite surfaceDestroyed() not being called.

We are able to detect when the Surface is in such a state from C++
code by calling ANativeWindow_getWidth(), as that will return a
negative value to indicate an error.

This patch uses this method to check whether the Surface is in such a
state prior to resuming the compositor. If so, rather than immediately
resuming the compositor it instead toggles the SurfaceView's
visibility. This tricks the SurfaceView in to providing a new (and
hopefully valid) Surface, which will in turn resume the compositor via
the surfaceChanged callback.

Differential Revision: https://phabricator.services.mozilla.com/D151479
2022-07-13 15:38:51 +00:00
Olivia Hall fab615eabb Bug 1777405 - GeckoView Intermittent in GeolocationTest onPause r=geckoview-reviewers,calu
In some test runs, the `onPause` Android Lifecycle event is not occuring
in the GeckoView test `GeolocationTest`.

Increasing the time between calling an `onPause` event (going Home)
and the `onResume` event (returning to app) will give the device more
time to complete the `onPause` event and return the expected results.

Differential Revision: https://phabricator.services.mozilla.com/D151031
2022-07-12 13:01:38 +00:00