Commit Graph

29792 Commits

Author SHA1 Message Date
Agi Sferro
596114f140 Bug 1601067 - Only send ActionDelegate:Attached when the delegate is not null. r=snorp
We use this to send a default action to the embedder, but if no one is
listening there's no point, and it causes problems in tests because sometimes
the delegate is attached / reattached too quickly and the second delegate will
end up getting two messages by mistake.

Differential Revision: https://phabricator.services.mozilla.com/D72974
2020-05-05 23:02:44 +00:00
Agi Sferro
25746f1383 Bug 1601067 - Catch exception thrown by newURI. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D73502
2020-05-05 23:02:42 +00:00
Mihai Alexandru Michis
d8308aa13f Backed out 9 changesets (bug 1601067) for causing gv failures in WebExecutorTest.
CLOSED TREE

Backed out changeset a57940d6af63 (bug 1601067)
Backed out changeset d16aa7b33165 (bug 1601067)
Backed out changeset f5d8f660ba87 (bug 1601067)
Backed out changeset 3b4e20521d4b (bug 1601067)
Backed out changeset b396fa314c25 (bug 1601067)
Backed out changeset 62f5d5d34162 (bug 1601067)
Backed out changeset fe94f4277bfa (bug 1601067)
Backed out changeset b15906852fe4 (bug 1601067)
Backed out changeset 23d021ef34c4 (bug 1601067)
2020-05-06 01:58:11 +03:00
Agi Sferro
69645103b4 Bug 1601067 - Add deprecation notice for registerWebExtension. r=droeh
Differential Revision: https://phabricator.services.mozilla.com/D73514
2020-05-05 22:19:42 +00:00
Agi Sferro
d713c54e7d Bug 1601067 - Make the test-support extension installable. r=owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72980
2020-05-05 22:19:30 +00:00
Agi Sferro
699cc8cf70 Bug 1601067 - Use installBuiltIn in tests instead of registerWebExtension. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D72979
2020-05-05 22:19:28 +00:00
Agi Sferro
859bdae8a8 Bug 1601067 - Implement installBuiltIn. r=mixedpuppy,owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72978
2020-05-05 22:19:26 +00:00
Agi Sferro
b86a9bfbf5 Bug 1601067 - Add IDs and nativeMessagingFromContent to tests. r=snorp
This in preparation to making these test extensions installable.

Differential Revision: https://phabricator.services.mozilla.com/D72977
2020-05-05 22:19:23 +00:00
Agi Sferro
f3d0825866 Bug 1601067 - Add nativeMessagingFromContent privileged permission. r=zombie,snorp
Installed privileged addons in GeckoView sometimes need to send messages from
content scripts. Today we use the in-memory flag `ALLOW_CONTENT_MESSAGING` to
allow a specific built-in addon to send messages from content scripts, but for
installed extensions we need a way to persist this flag.

To do this, this patch introduces a new privileged permission
`nativeMessagingFromContent`, when this permission is present in the manifest,
the addon will be allowed to send native messages from content scripts (note:
the addon will also need `nativeMessaging` as usual).

When the permission is not present, any attempt to send a native message from a
content script will result in an error, similarly to what happens before this
patch.

Differential Revision: https://phabricator.services.mozilla.com/D72976
2020-05-05 22:19:13 +00:00
Agi Sferro
5dd2be61eb Bug 1601067 - Collect NewTab messages until a delegate is registered. r=snorp
Sometimes extensions call tabs.create immediately on startup. In that case the
delegate may not be attached yet. To avoid losing these messages we store them
until a delegate is attached.

This also includes a refactoring to unify behavior for delegates. Eventually I
want to factor out delegates similarly to what happens in GeckoSession today.

Differential Revision: https://phabricator.services.mozilla.com/D72975
2020-05-05 22:19:11 +00:00
Agi Sferro
df91383e8d Bug 1601067 - Only send ActionDelegate:Attached when the delegate is not null. r=snorp
We use this to send a default action to the embedder, but if no one is
listening there's no point, and it causes problems in tests because sometimes
the delegate is attached / reattached too quickly and the second delegate will
end up getting two messages by mistake.

Differential Revision: https://phabricator.services.mozilla.com/D72974
2020-05-05 20:54:00 +00:00
Agi Sferro
04097efffa Bug 1601067 - Catch exception thrown by newURI. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D73502
2020-05-05 20:54:00 +00:00
Aaron Klotz
bebfb567e8 Bug 1635173: Add GeckoSessionTestRule.getSessionPid() to junit; r=agi,geckoview-reviewers
To support this API, we do the following:

Additions to `GeckoSessionTestRule`:
* We add an overload to `webExtensionApiCall` that accepts a `GeckoSession`
  argument. Instead of sending the message to the extension's background script,
  this overload instead sends the message to the port for the session's
  content script.
* We add `GeckoSessionTestRule.getSessionPid()` which uses the new
  `webExtensionApiCall` overload. Moving other existing APIs over to use the
  new overload is out of scope for this bug and should be done in follow-ups.

Additions to the `test-support` extension:
* We modify the content script to receive an API call message from the native
  port. It then forwards the request up to the background script. By doing it
  this way, the background script will receive the message along with the
  WebExtension `Tab` object belonging to the sender;
* The background script's message handler merges the tab into the arguments
  to the API as a `tab` property;
* The background script then calls the API and the result is returned to
  the harness using the native port, just like the normal implementation;
* We add a `GetPidForTab` API for resolving top-level PIDs from a webext tab id.

Differential Revision: https://phabricator.services.mozilla.com/D73723
2020-05-05 18:43:56 +00:00
Ian Moody
011b59d595 Bug 1536556 - Replace raw thrown Cr.ERRORs with Components.Exception. r=mossop,remote-protocol-reviewers,marionette-reviewers,whimboo,necko-reviewers,geckoview-reviewers,valentin,agi
Raw Cr.ERROR don't get stack information, same as throwing JS literals instead
of `new Error()`s.

This was done automatically with a new eslint rule that will be introduced in
the next commit.  One instance of a raw Cr.ERROR was not replaced since it is
used in a test that specifically checks the preservation of raw Cr values in
XPCJS.  The rule will be disabled for that instance.

Differential Revision: https://phabricator.services.mozilla.com/D28073
2020-05-05 17:41:36 +00:00
Agi Sferro
58bc52365d Bug 1634493 - Add GVE setting for extensions in private browsing. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D73771
2020-05-05 18:07:47 +00:00
Agi Sferro
69074e75ca Bug 1634493 - Wait for extension policy to be ready. r=aklotz
When exporting the addon object, the extension policy sometimes is not ready
yet (very common when `list()` is called at startup), so we need to wait until
it's ready or the values in it will not be correct.

Differential Revision: https://phabricator.services.mozilla.com/D73770
2020-05-05 18:07:40 +00:00
Rob Wu
f7f88112a2 Bug 1634671 - Add RS dump of addons-bloomfilters blocklist to Android r=agi
These support the new implementation of the addon blocklist (bug 1620621),
which is a more space-efficient way to represent the blocklist.

A comparison of file size was given in D73159. In short, 913KB for the
old JSON-based blocklist (addons.json), 64KB for the new one.

In practice, addons.json is 273KB compressed.

The new blocklist (addons-mlbf.bin) does not compress that well since it
is already an efficiently packed binary format.

Differential Revision: https://phabricator.services.mozilla.com/D73438
2020-05-01 19:36:43 +00:00
owlishDeveloper
c0adc6fa58 Bug 1634710 - Update GeckoView Quick Start for Contributors with info on adb and logcat r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73467
2020-05-01 19:44:44 +00:00
owlishDeveloper
ac48ff2312 Bug 1623153 - Prevent app hanging when updating disabled web extensions r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73399
2020-05-01 18:06:07 +00:00
Dylan Roeh
e457bb1b2c Bug 1630073 - Reenable WebExtensionTest.loadWebExtensionPage. r=agi
Differential Revision: https://phabricator.services.mozilla.com/D73323
2020-04-30 18:29:32 +00:00
Aaron Klotz
3e64cd6ca9 Bug 1630229: Part 3 - Include process type in AssertionError message; r=geckoview-reviewers,agi
This is to make it easier to figure out what is doing this.

Differential Revision: https://phabricator.services.mozilla.com/D72968
2020-04-30 00:03:15 +00:00
Makoto Kato
fc29e1e8e1 Bug 1596920 - Don't set selection on dispatching key event if unnecessary. r=geckoview-reviewers,snorp
Actually we emulate key event (down, press and up) from replace transaction of
`Editable`. When dispatching key press, we always update current caret position.

Most situations is the following.
1. Dispatch keypress
2. Dispatch another keypress
3. Receive merged text/selection change result by 1. and 2.
4. Sync shadow (Java's Editable) text with 3.'s result. It means selection is
   correct position now.
5. Dispatch keypress with correct position.

When this issue occurs, the following situation occurs.
1. Dispatch keypress
2. Dispatch another keypress
3. Receive text/selection change result of 1.
4. Sync shadow (Java's Editable) text with 3.'s result. It means selection is
   old position now.
5. Dispatch another keypress with old position.
6. Receive text/selection change result of 2.
7. Receive text/selection change result of 5.

So when dispatching key press, we shouldn't always update selection if unnecessary.
Because selection range is already often set before dispatching key press.

Differential Revision: https://phabricator.services.mozilla.com/D71179
2020-04-28 14:02:10 +00:00
owlishDeveloper
53e87dce1e Bug 1626687 - Do not handle data URIs larger than 2M on mobile r=necko-reviewers,geckoview-reviewers,valentin,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72955
2020-04-29 18:07:39 +00:00
jayati
8a94be457d Bug 1634012 - Remove the browser.tabs.showAudioPlayingIcon pref.r=dao
Differential Revision: https://phabricator.services.mozilla.com/D73084
2020-04-29 17:22:48 +00:00
Shane Caraveo
35a1cb2c57 Bug 1630413 don't prompt for unlimitedStorage extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71812
2020-04-22 20:51:52 +00:00
Dylan Roeh
8276ad5d0e Bug 1632231 - Fix potential crash by gracefully failing when GV tries to add/remove/check content blocking exceptions for invalid URIs. r=esawin
Differential Revision: https://phabricator.services.mozilla.com/D72012
2020-04-29 16:45:27 +00:00
Aaron Klotz
e544916dbe Bug 1622944: Update xMultipleSessions junit tests to be sensitive to dom.ipc.processCount; r=geckoview-reviewers,agi
We need to move these tests to their own class so that we can add a `@Before`
function to set up the expected start conditions.

We also need to allocate the second session in such a way that it is
hosted by the same content process as `mainSession`.

The previous scheme of waiting on each `GeckoResult` independently caused
deadlocks if the results are resolved in a different order, so I replaced those
two waits with a `GeckoView.allOf` result that will Just Work (TM).

Note that this scheme works both in single-e10s and multi-e10s
configurations.

Differential Revision: https://phabricator.services.mozilla.com/D67067
2020-04-28 21:50:06 +00:00
Shane Caraveo
cb8a65428f Bug 1444294 implement browser.permissions onAdded/Removed r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D71231
2020-04-27 16:20:12 +00:00
Makoto Kato
5eef0ef386 Bug 1612278 - Part 2. Re-enable TextInputDelegateTest#inputConnection. r=geckoview-reviewers,agi
Turn on some tests for InputConnection's behaviors. `inputConnection_setSelection` and `inputConnection_bug1133802` are still disabled due to Gecko issue and no good events.

Although I repeat 30 times to run this after this, no error now.

Differential Revision: https://phabricator.services.mozilla.com/D71151
2020-04-27 07:42:33 +00:00
Makoto Kato
33984be87d Bug 1612278 - Part 1. Add utility functions in TextInputDelegateTest. r=geckoview-reviewers,agi
I would like to add some common functions to wait various events.

Differential Revision: https://phabricator.services.mozilla.com/D71150
2020-04-27 07:42:26 +00:00
Makoto Kato
f4194acef4 Bug 1612251 - Use Executors.newSingleThreadScheduledExecutor to support <10ms sampling. r=julienw
Actually, we use `Thread.sleep` to get next sampling duration. But as long as
old comment, this sampling min duration is 10ms. But when I test
`Executors.newSingleThreadScheduledExecutor` on old device (10 year's old
Galaxy Nexus) instead of Thread.sleep, it can use 2ms sampling duration.

So we should use ScheduledExecutorService instead.

Differential Revision: https://phabricator.services.mozilla.com/D70401
2020-04-27 02:16:54 +00:00
Masayuki Nakano
6cbea10c99 Bug 1632724 - part 1: Move common methods for handling delete selection to EditorBase r=m_kato
`DeleteSelection*()` are members of `TextEditor`, but they are also used by
`HTMLEditor`.  Therefore, they and pref cache members for them should be
in `EditorBase` too.

Depends on D71911

Differential Revision: https://phabricator.services.mozilla.com/D72290
2020-04-24 14:55:09 +00:00
Agi Sferro
1c11cbd114 Bug 1632922 - use const instead of let - manual fixes. r=snorp
This commit was generated manually fixing all remaining eslint failures.

Differential Revision: https://phabricator.services.mozilla.com/D72413
2020-04-24 21:53:19 +00:00
Agi Sferro
dff7aa5d42 Bug 1632922 - use const instead of let - eslint --fix r=snorp
This commit was generated by running `./mach eslint --fix`.

Differential Revision: https://phabricator.services.mozilla.com/D72412
2020-04-24 21:53:17 +00:00
Agi Sferro
cef279c2d6 Bug 1632922 - Remove unused mobile/android/tests. r=snorp
This folder is entirely made up of chrome tests that we don't run anymore.

Differential Revision: https://phabricator.services.mozilla.com/D72428
2020-04-24 21:53:10 +00:00
Agi Sferro
2291f694fb Bug 1535365 - Disable extension process. r=snorp,rbarker
We don't currently restart the extension process and this causes extensions to
randomly stop working when Android kills the extension process.

We can re-enable it once Bug 1355239 is fixed.

Differential Revision: https://phabricator.services.mozilla.com/D71790
2020-04-24 19:07:24 +00:00
Ricky Stewart
725728fc20 Bug 1621451 - Remove remaining in-build references to Python 2 GENERATED_FILES as well as underlying build system support r=dmajor
We still need to resolve bug 1621448, at which point we can delete the `py_action` macro entirely.

Differential Revision: https://phabricator.services.mozilla.com/D71795
2020-04-22 17:34:23 +00:00
Paul Bone
4e341bce84 Bug 1603007 - Remove allowLinkedWebInFileUriProcess r=nika
This patch removes the allowLinkedWebInFileUriProcess pref, but one
code-path is kept because when DocumentChannel is disabled a HTTP POST load
from a file:// page would loose the postData, so that case keeps the FILE
remote type.

Differential Revision: https://phabricator.services.mozilla.com/D69923
2020-04-23 17:15:09 +00:00
Kartikaya Gupta
17a76bc82d Bug 1627716 - Remove unused constants. r=geckoview-reviewers,agi
Depends on D71779

Differential Revision: https://phabricator.services.mozilla.com/D71780
2020-04-22 11:50:41 +00:00
Kartikaya Gupta
763e05dece Bug 1627716 - Remove GeckoView API exposing the DynamicToolbarAnimator. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D71776
2020-04-22 11:50:40 +00:00
alwu
d09fa27d37 Bug 1625615 - part1 : update 'suspendMediaWhenInactive' when GeckoView setting changes r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D69884
2020-04-22 02:08:27 +00:00
Dylan Roeh
c9d7201a13 Bug 1631206 - Update NavigationDelegateTest.extensionProcessSwitching to check whether or not extension process is enabled. r=agi
Differential Revision: https://phabricator.services.mozilla.com/D71828
2020-04-21 23:07:57 +00:00
Agi Sferro
2bd2eb8ceb Bug 1631137 - Add APP to EnableSources. r=esawin
This was missed when implementing EnableSource.APP.

Differential Revision: https://phabricator.services.mozilla.com/D71671
2020-04-21 15:49:37 +00:00
Agi Sferro
c62bcbc6e5 Bug 1631137 - Wait for Schema to be initialized in shouldPromptFor. r=esawin,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D71568
2020-04-21 15:51:47 +00:00
Emilio Cobos Álvarez
3cb235302a Bug 1631776 - Convert some imagedocument prefs to static prefs. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D71753
2020-04-21 15:40:55 +00:00
Agi Sferro
57201fb4bc Bug 1631054 - Enable the extension process only on nightly. r=droeh
Differential Revision: https://phabricator.services.mozilla.com/D71381
2020-04-17 18:55:03 +00:00
Coroiu Cristina
43be71277d Backed out 2 changesets (bug 1625500) for multiple failures on a CLOSED TREE
Backed out changeset 7d80233bcfcd (bug 1625500)
Backed out changeset 0a35b13dfcde (bug 1625500)
2020-04-17 15:36:05 +03:00
Gijs Kruitbosch
cc39a339a0 Bug 1625500 - fix use of .then(x, x) in the tree, r=marionette-reviewers,Standard8,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D68614
2020-04-17 11:41:49 +00:00
Emilio Cobos Álvarez
905a775721 Bug 1482147 - Fix the expectation of a GeckoView test which was relying on this bug. r=agi
It makes no sense that the first thing in the session would be considered as
wrapping, it was happening only because we were incorrectly failing to find a
"visible" range deep in Gecko (so we started back from the beginning of the
document, wrapping).

Differential Revision: https://phabricator.services.mozilla.com/D71157
2020-04-16 21:47:51 +00:00
pbz
27a54fedb1 Bug 1615588 - Extended GeckoView prompt implementation to support prompting by BrowsingContext. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D70645
2020-04-16 14:44:10 +00:00