Commit Graph

3188 Commits

Author SHA1 Message Date
Shane Caraveo
1ca61e7334 Bug 1748562 support persistent listeners in omnibox api r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D140893
2022-03-16 15:02:32 +00:00
Luca Greco
7cff6e4c3c Bug 1759162 - Fix pkcs11.isModuleInstalled regressions triggered on non-windows builds. r=barret,willdurand
PathUtils.filename throws if the path is not an absolute path, which was likely
not the case with the OS.Path.basename call used previously.

This internal change of behavior shouldn't be triggering any issue on Windows,
where the hostInfo.manifest.path seems to be always normalized into an absolute
path (by computing it as relative to the hostInfo.manifest if it wasn't already
an absolute path), but it makes browser.pkcs11.isModuleInstalled to regress
on Linux (and maybe also on MacOS if the pkcs11 manifest files include only
the library name and not its full path, as it seems to be the case for
the Belgium eID pkcs11 manifest packaged for Linux).

The result of PathUtils.filename is expected to only include the basename of
the file (without the full dir path and the file extension) and so to fix
the regression being triggered on non-windows platform we could use a fake
absolute url to get the expected result using PathUtils.filename as is.

Differential Revision: https://phabricator.services.mozilla.com/D141097
2022-03-15 20:13:16 +00:00
Shane Caraveo
1c30b7cc0a Bug 1759073 move eventpage test functions into ExtensionTestCommon r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D140783
2022-03-15 17:48:36 +00:00
Olli Pettay
738eda667b Bug 1503404, try to make head_pageAction.js a tad more stable, r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D140974
2022-03-14 16:35:58 +00:00
Rob Wu
62d7f3b4a3 Bug 1756663 - Add test for id option of history.onTitleChanged r=willdurand
In bug 1678611, the id property was added to this event, without unit
tests. The existing test didn't pick up the change because it checked
for a specific property. This patch adds a check of the whole event
object to get coverage for the id property AND to avoid this kind of
issue in the future.

Differential Revision: https://phabricator.services.mozilla.com/D139408
2022-02-24 18:15:09 +00:00
Shane Caraveo
4d330e8910 Bug 1682681 fix intermittent context menu failure on non-visible elements r=robwu
If elements added to the doc were not visible, context-click on
the element would fail because composedTarget.ownerDocument is null.

Differential Revision: https://phabricator.services.mozilla.com/D138190
2022-02-19 23:27:02 +00:00
Shane Caraveo
e38cc78870 Bug 1753308 fix extension startup in tests, remove delayed startup pref r=rpl,robwu
Differential Revision: https://phabricator.services.mozilla.com/D137699
2022-02-19 15:52:26 +00:00
Drew Willcoxon
db5729e7fe Bug 1754588 - Part 1: Generalize buttons in UrlbarView and add a block button to best match rows. r=dao
This adds a block button to best match rows. The button looks similar to the `?`
help button. For best match rows, both the block and help buttons appear, with
the block button first.

Figma spec, see "Top pick proposal
for Firefox 99 - awesomebar":
https://www.figma.com/file/seJ2ZA4v3FgoV7jCxUR74B/Firefox-Suggest?node-id=4937%3A67136

This does not handle clicks on the button because that will be covered by bug
1754591 and bug 1754594.

To test this, the easiest way is still probably to pause browser_bestMatch.js.
You can use the `nonsponsored()` task to test the block button by itself and
`nonsponsoredHelpButton()` to test with a help button; pause before the
`promisePopupClose()` at the end. If that's not practical I can post my WIP for
triggering best matches and you'll need to enable Firefox Suggest too.

To implement this I generalized the existing help button code into a way to add
arbitrary buttons. Instead I could have duplicated it, but that's not as nice
and it makes the CSS a little uglier because we'd need rules for handling the
help button alone, the block button alone, and both (although there are no plans
to show the block button alone). In addition, eventually we want a way to report
inappropriate suggestions so there's been discussion about having a report
button too. It may turn out that we add a single `...` button for everything,
but it's not clear yet.

I tweaked the button style a little to match the new spec. Help buttons in the
usual Firefox Suggest rows will get these tweaks too of course. The help button
(and block button) are now smaller, have smaller margins, and their hover
background color is the same as the color for rows.

Finally, I noticed we're not correctly updating `item[role]` when reusing a row
and going from without a help button to with a help button, or vice versa, so
this fixes that too.

Differential Revision: https://phabricator.services.mozilla.com/D138508
2022-02-17 05:02:41 +00:00
Butkovits Atila
2995e1b1c0 Backed out changeset 5d7859b835a5 (bug 1682681) for causing failures at browser_ext_contextMenus.js. CLOSED TREE 2022-02-12 03:45:02 +02:00
Shane Caraveo
14e7f84678 Bug 1682681 fix intermittent context menu failure on non-visible elements r=robwu
If elements added to the doc were not visible, context-click on
the element would fail because composedTarget.ownerDocument is null.

Differential Revision: https://phabricator.services.mozilla.com/D138190
2022-02-11 23:58:07 +00:00
Joel Maher
6d769aee7c Bug 1750839 - Enable fission browser-chrome for variants. r=mccr8,releng-reviewers,gbrown
Differential Revision: https://phabricator.services.mozilla.com/D136512
2022-02-01 19:30:34 +00:00
William Durand
61759c7e90 Bug 1751154 - More consistent error handling for frameIds parameter in scripting API. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D137005
2022-01-28 19:13:05 +00:00
Shane Caraveo
afbca3636b Bug 1748524 sleep/waken functionality for background, restartable via persistent events r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D135812
2022-01-25 20:49:15 +00:00
Andrei Oprea
f64147a52f Bug 1746598 - Route MS messages to PB newtab r=dmose,extension-reviewers,rpl
Differential Revision: https://phabricator.services.mozilla.com/D134157
2022-01-25 13:02:30 +00:00
Barret Rennie
c7144b841e Bug 1745352 - Remove osfile.jsm from browser/components/extensions r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D133843
2022-01-25 12:16:17 +00:00
Marian-Vasile Laza
9447e468f8 Backed out changeset 2f4c63b2e472 (bug 1748524) for causing xpcshell failures on test_ext_alarms.js. CLOSED TREE 2022-01-25 01:26:30 +02:00
Shane Caraveo
64d3fc1694 Bug 1748524 sleep/waken functionality for background, restartable via persistent events r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D135812
2022-01-24 21:18:28 +00:00
Luca Greco
d34773dbd8 Bug 1746841 - Explicitly clear cached resources associated to an extension being installed/upgraded/downgraded or installed temporarily. r=mixedpuppy
This patch contains a proposed approach for the longer term fix we agreed on (see Bug 1746841 comment 10 and comment 11) and replace the
mochitest-browser added in the other patch attached to this bug with an xpcshell test (which besides covering the same base scenario
that mochitest-browser was convering, it is also lighter and covers also other cases that were not explicitly covered yet).

- added also an image to the test extension to explicitly verify the image caching behavior is also covered and works as expected
- added a test case to verify that cache images aren't cleared when the addon is permanently installed and it is not starting for an upgrade/downgrade

Differential Revision: https://phabricator.services.mozilla.com/D134508
2022-01-19 19:58:12 +00:00
Csoregi Natalia
705ffd58b4 Backed out 2 changesets (bug 1745352) for failures on test_ext_pkcs11_management.js. CLOSED TREE
Backed out changeset 0975c59084aa (bug 1745352)
Backed out changeset ba57b662bb72 (bug 1745352)
2022-01-19 06:16:46 +02:00
Barret Rennie
8df77245f5 Bug 1745352 - Remove osfile.jsm from browser/components/extensions r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D133843
2022-01-19 01:17:46 +00:00
Kershaw Chang
74a65c68ee Bug 1741425 - Enable more mochitest with socket process, r=ahal,webdriver-reviewers,preferences-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D134485
2022-01-11 09:49:45 +00:00
Jonathan Watt
79109555b9 Bug 1702501 - Remove print.tab_modal.enabled pref and old frontend print preview code. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D134699
2022-01-06 18:55:38 +00:00
Rob Wu
cb2c04da02 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-06 14:15:47 +00:00
Alexandru Michis
8282e82b21 Backed out changeset 4ae7738694e1 (bug 1748158) for causing xpcshell failures in test_ext_native_messaging_permissions.js
CLOSED TREE
2022-01-06 02:55:58 +02:00
Rob Wu
5be369dc94 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-05 20:41:07 +00:00
Marian-Vasile Laza
d4d55e1595 Backed out changeset 0bf0fa6d8a5a (bug 1748158) for causing xpcshell failures on test_ext_native_messaging_permissions.js. CLOSED TREE 2022-01-05 04:05:14 +02:00
Rob Wu
c686f79b28 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-04 23:07:16 +00:00
Mathew Hodson
25adf33c38 Bug 1746709 - Use ChromeUtils.import with one parameter in test_GMPInstallManager.js. r=robwu
Export new `ProductAddonCheckerTestUtils` for methods only used by
tests.

Differential Revision: https://phabricator.services.mozilla.com/D134217
2022-01-04 17:36:49 +00:00
Rob Wu
61ab2f283b Bug 1746494 - Account for invalid linkUrls in context menus r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D134918
2022-01-03 13:10:23 +00:00
Emilio Cobos Álvarez
327f1b06be Bug 1746310 - Make panels and menupopups not have their children in the flat tree if not initialized. r=Gijs
This is almost a revert of bug 1741089 (just with the relevant test fix
and so on). With the previous patch, for something like:

  <menupopup>
    <menuitem />
  </menupopup>

We would still generate the frames for the menuitem. That causes various
a11y tests to fail and starts loading images used by the menuitem which
was caught by browser_startup_images.js.

Make the children completely invisible to layout by keeping them
unslotted. This makes getComputedStyle on them return an empty style,
but only one test was depending on that.

Depends on D134331

Differential Revision: https://phabricator.services.mozilla.com/D134606
2021-12-23 12:55:34 +00:00
Luca Greco
3d6c558360 Bug 1746841 - Add a test case to verify that css cached for moz-extension urls are not used after the addon is updated. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D134438
2021-12-22 11:47:00 +00:00
Gijs Kruitbosch
5c07ced6c2 Bug 1747065 - remove plugin.load_flash_only setters which are no-ops r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D134398
2021-12-21 14:34:48 +00:00
Dana Keeler
c80332b1ff Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,glandium,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Depends on D130820

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-18 01:30:24 +00:00
Anny Gakhokidze
16a415a10f Bug 1721217 - Part 9: Write tests for making sure that parent initiated network requests get cancelled after we remove the tab or cancel the load, r=nika,robwu,zombie
Differential Revision: https://phabricator.services.mozilla.com/D130197
2021-12-16 22:27:18 +00:00
Jonathan Watt
d70db9baf8 Bug 1745452 - Remove the print progress dialog code. r=mstriemer,bobowen,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D133500
2021-12-16 15:12:33 +00:00
Emilio Cobos Álvarez
56e23db6d4 Bug 1744749 - Use windowUtils.canvasBackgroundColor to get the web extension background. r=extension-reviewers,robwu
Make popup browsers non-transparent so that we can get a meaningful
canvas background-color from layout. I don't think it matters since
popups are not meaningfully transparent since bug 1449933.

Depends on D133772

Differential Revision: https://phabricator.services.mozilla.com/D133773
2021-12-16 14:56:33 +00:00
Butkovits Atila
6c14d03852 Backed out changeset 51d7c5d96ceb (bug 1745452) for causing failures at browser_all_files_referenced.js. CLOSED TREE 2021-12-16 15:13:34 +02:00
Jonathan Watt
260ef48d25 Bug 1745452 - Remove the print progress dialog code. r=mstriemer,bobowen,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D133500
2021-12-16 11:45:59 +00:00
Cosmin Sabou
cda3042731 Backed out 2 changesets (bug 1712837) for causing an increase in crashes (bug 1735798). a=backout
Backed out changeset 51773d1ab7b5 (bug 1712837)
Backed out changeset 97b0a77e4ce7 (bug 1712837)
2021-12-15 12:24:03 +02:00
Luca Greco
0d8fc19cd9 Bug 1735899 - Cover the browserAction popup preload with a smoketest. r=mixedpuppy
This patch includes a new test file to cover a scenario similar to the one
fixed in Bug 1735899, and possibly some other similar ones that may slip
through unnoticed.

This test triggers the issue consistently on a build where the fix
is not included and pass consistently in build including the fix,
but even if it doesn't include any arbitrary timeouts to trigger the
issue there is still a chance that the test may start to fail
intermittently for some other reasons.

Keeping it as a separate test file will make it easier to disable it
as a temporary measure if turns out to be necessary.

Differential Revision: https://phabricator.services.mozilla.com/D132267
2021-12-14 19:15:15 +00:00
Dana Keeler
a03ae7ed1f Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-13 23:59:08 +00:00
Jonathan Watt
bb0276ec0f Bug 1745322 - Only test the new UI in browser/components/extensions/test/browser/browser_ext_tabs_printPreview.js. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D133447
2021-12-10 16:05:50 +00:00
Cristian Tuns
401fef52eb Backed out changeset 5396b58ddae7 (bug 1712837) for causing Android ARMv7 build bustages. a=backout 2021-12-10 09:35:39 -05:00
Dana Keeler
aa200d9a1e Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-10 00:24:49 +00:00
Richa Sharma
f690bb5cd5 Bug 1730931 - Supporting an array of cookieStoreId in the tabs.query API. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D125868
2021-12-07 13:46:53 +00:00
Rob Wu
b6b78cf0cc Bug 1714846 - Really hide panels on hide, r=robwu,emilio
Differential Revision: https://phabricator.services.mozilla.com/D132574
2021-12-07 11:50:19 +00:00
Andreea Pavel
58063719cd Backed out 2 changesets (bug 1712837) for win build bustages on a CLOSED TREE
Backed out changeset e754af875d57 (bug 1712837)
Backed out changeset 020eaab241a8 (bug 1712837)
2021-12-07 02:21:09 +02:00
Dana Keeler
8aceb5730c Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika,jschanck
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-12-06 23:43:32 +00:00
Butkovits Atila
f90ffaea22 Backed out changeset 6e298bdd0dd8 (bug 1714846) for causing assertion failures at CompositorBridgeParent.cpp. CLOSED TREE 2021-12-03 23:30:10 +02:00
Rob Wu
68e93f997c Bug 1714846 - Really hide panels on hide, r=robwu,emilio
Differential Revision: https://phabricator.services.mozilla.com/D132574
2021-12-03 19:16:51 +00:00