Commit graph

1672 commits

Author SHA1 Message Date
Luca Greco
3bb3ba6361 Bug 1480292 - Fix browser_ext_popup_select intermittent failures. r=mixedpuppy
From what I saw by reproducing it locally (e.g. I've also been able to trigger it locally pretty often on linux64 by using "./mach mochitest --verify"), the select popup may sometimes be still using part of its previous position while switching between the test case for the browserAction and the test case for the pageAction.

On linux64 this test was also (from time to time) sending the mouse event when the select element wasn't yet ready to be clicked in the extension popup.

This patch aims to make the behaviors of this test more stable by applying the following changes:
- disable the cosmeticAnimations while running these tests
- explicitly wait the select element in the popup (using ContentTask.spawn and ContentTaskUtils.waitForCondition) before sending it a mouse event
- explicilty close the select popup (and wait the select popup to be hidden) before proceeding to the next test case

The following push to try seems to confirm that these changes are helping to make the test more stable:
- https://treeherder.mozilla.org/#/jobs?repo=try&revision=086c526724ba409068d679036dd3ef13788535b6&selectedJob=194152144

Differential Revision: https://phabricator.services.mozilla.com/D3438

--HG--
extra : moz-landing-system : lando
2018-08-16 13:19:03 +00:00
Luca Greco
4d5dd95038 Bug 1446274 - Fix browserAction popup resize test intermittency due to initial popup height being detected while still resizing. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3349

--HG--
extra : moz-landing-system : lando
2018-08-15 12:11:19 +00:00
Cosmin Sabou
1c8ad7b4ba Merge mozilla-inbound to mozilla-central. a=merge 2018-08-15 03:51:45 +03:00
Brian Grinstead
829d7647d3 Bug 1479538 - Rewrite non-test callers of document.createElementNS(XUL_NS, ...) to use document.createXULElement(...);r=paolo
Differential Revision: https://phabricator.services.mozilla.com/D3275

--HG--
extra : moz-landing-system : lando
2018-08-14 16:22:44 +00:00
Kris Maglione
f99ee35b82 Bug 1480244: Part 5 - Run most framescripts in shared scope. r=mconley
Creating non-shared scopes for frame scripts is fairly expensive. After these
changes it's even more expensive. However, many frame scripts have no use for
the shared scopes at all. Run-once scripts which execute in closures, for
instance, make no use of them. And after bug 1472491, neither do most of our
default frame scripts.

MozReview-Commit-ID: 9PK7bYdQ0yh

--HG--
extra : rebase_source : db2516d2f00a75e233e1957649f2b62a9299b7cd
2018-08-10 13:58:18 -07:00
Kris Maglione
24dc48a4df Bug 1480244: Part 3a - Fix non-strict-mode test code which expects this to be bound to its global. r=aswan
A lot of the ad-hoc frame scripts we execute for tests does not run in strict
mode, and therefore has its functions' `this` objects set to the global when
they are called without a target object.

At the moment, this gives them a MessageManager global. Once message managers
become non-global objects, however, it will give them the shared JSM global,
which is not what they expect.

This patches changes scripts which rely on this to explicitly capture or set
the appropriate `this` object for their calls.

MozReview-Commit-ID: DY8DDb0xE1K

--HG--
extra : rebase_source : 86c1fa4df070711f666dfee5487182afe28a7611
2018-08-03 14:33:38 -07:00
Cosmin Sabou
1cd617cf3c Backed out 2 changesets (bug 1482610) for mochitest failures on test_keycodes.xul. CLOSED TREE
Backed out changeset 79a59b25e535 (bug 1482610)
Backed out changeset f5873a719ec0 (bug 1482610)
2018-08-14 20:58:27 +03:00
Kris Maglione
56ec495c3d Bug 1472491: Part 5p - Add ExtFindChild actor. r=mikedeboer f=felipe
MozReview-Commit-ID: 3zL8iYeYAPx

--HG--
extra : rebase_source : 8d6d2f4b9776d6e66b66da7fbeba826056afe77d
2018-07-29 21:44:48 -07:00
Kris Maglione
8556b44e55 Bug 1472491: Part 5k - Add NetErrorChild actor. r=johannh f=felipe
MozReview-Commit-ID: EclR3sogB4i

--HG--
rename : browser/modules/NetErrorContent.jsm => browser/actors/NetErrorChild.jsm
extra : rebase_source : e5c2337d220ede90f577cec80035d9116c348fc2
2018-07-29 21:00:29 -07:00
Kris Maglione
a9fef908c6 Bug 1472491: Part 5e - Add ContextMenuChild actor. r=felipe
MozReview-Commit-ID: GUJfyCPkRw8

--HG--
rename : browser/modules/ContextMenu.jsm => browser/actors/ContextMenuChild.jsm
extra : rebase_source : 3454bf58882fedf39842e2c2af38e52c44959eac
2018-07-29 20:07:33 -07:00
Oriol Brufau
dea5810226 Bug 1474440 - Implement support for the 'onHighlighted' API for multiselect tabs r=mixedpuppy
MozReview-Commit-ID: 8aOmdj0AB3e

--HG--
extra : rebase_source : 5eec0163341b6621103ac4a5e43f8439a19a9c5a
2018-07-28 13:15:55 +02:00
Oriol Brufau
f76978b8ec Bug 1474440 - Rename browser_ext_tabs_onHighlighted.js to browser_ext_tabs_events_order.js r=mixedpuppy
Basically it tests in which order various tab events are dispatched, so the old name
didn't make sense, and it will be more suited for a new test specific to onHighlighted.

MozReview-Commit-ID: Kj8GZfHA0Ap

--HG--
rename : browser/components/extensions/test/browser/browser_ext_tabs_onHighlighted.js => browser/components/extensions/test/browser/browser_ext_tabs_events_order.js
extra : rebase_source : 243155e897d08bd70091c6a7ee11b4671a098ef2
2018-08-05 22:08:34 +02:00
Peter Simonyi
c3ec2fa929 Bug 1469705: allow menus.refresh() without an onShown listener r=mixedpuppy
MozReview-Commit-ID: 3GbQEoSFTW8

--HG--
extra : rebase_source : cfb50b104e14c1e38b319c207164c96c3fa0f55e
2018-07-05 22:06:23 -04:00
Csoregi Natalia
81732c6774 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-13 18:44:46 +03:00
Rob Wu
f0b033f907 Bug 1481179 - Stop extensions from changing the icon in the top-level menu r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3198

--HG--
extra : moz-landing-system : lando
2018-08-13 13:25:50 +00:00
Jonathan Kingston
a91f8e8108 Bug 1466801 - Flipping disallowInheritPrincipal to be allow. r=ckerschb r=gijs
--HG--
rename : browser/base/content/test/general/browser_utilityOverlay.js => browser/base/content/test/contextMenu/browser_utilityOverlay.js
extra : source : 5eab8f37c4bd6048057069cb0ac2ab0b4729d950
2018-07-16 10:17:51 +01:00
ExE Boss
49402056bc Bug 1482411 - Port bug 1371951 changes to extension-mac.css r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3112

--HG--
extra : moz-landing-system : lando
2018-08-10 15:00:35 +00:00
Bogdan Tara
dfe849c923 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-11 06:46:31 +03:00
Bogdan Tara
89268618f4 Backed out changeset c9b0ce46ad4f (bug 1466801) for pause-remove-from-document-networkState.html failures CLOSED TREE
--HG--
rename : browser/base/content/test/contextMenu/browser_utilityOverlay.js => browser/base/content/test/general/browser_utilityOverlay.js
2018-08-11 03:20:30 +03:00
Bogdan Tara
2f2b719960 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-08-11 01:01:18 +03:00
Rob Wu
c036fd8591 Bug 1325814 - Support shadow DOM in menus.getTargetElement + test r=mixedpuppy
MozReview-Commit-ID: JzVM8wVpaeP

--HG--
extra : rebase_source : 00cdbf78a0f442cd4ab9fe0f93f567834e49def6
2018-08-08 18:06:41 +02:00
Rob Wu
ce07a9471f Bug 1325814 - Add tests for menus.getTargetElement API r=mixedpuppy
The tests are split in two files:

- browser_ext_menus_targetElement.js to test interaction with web pages
  via content scripts.

- browser_ext_menus_targetElement_extension.js to test interaction
  with menus in extension processes.

And browser_ext_menus_events.js was updated to recognize the new
property.

MozReview-Commit-ID: F0HEiNADRuM

--HG--
extra : rebase_source : 1f304c37a024ec94e2a8104bd7ae3d53eb68aa60
2018-08-04 18:40:54 +02:00
Rob Wu
23cf8852bb Bug 1325814 - Add extension API to find menu target r=mixedpuppy
- Add info.targetElementId to menus.onShown event.

- Add info.targetElementId to menus.onClicked event.

- Add menus.getTargetElement API that is available to all contexts,
  including content scripts, which allows extensions to get the DOM
  element for a given targetElementId.

- Add new schema instead of re-using schemas/menus.json to avoid sending
  too much schema data (of the existing menus API) to content processes.

MozReview-Commit-ID: 6Onf7jZlIho

--HG--
extra : rebase_source : eb095d04ce381606be90d325712bfc57233d8291
2018-08-04 18:09:49 +02:00
Rob Wu
4f7e9cca86 Bug 1325814 - Remove unnecessary schemas/menus_internal.json r=mixedpuppy
This schema was inherited from Chromium (where it was an internal
implementation detail. This schema only defined the OnClickData
type, but was never actively used by our WebExtensions framework,
because menus.json already defines the OnClickData type.

Note: menus_internal.json specified the "menusInternal" namespace
which we do indeed implement in parent/ext-menus.js (and use in
child/ext-menus.js). However, none of the methods that we add to
menusInternal are actually defined in the schema.
This use of menusInternal was introduced in part 2 of bug 1333403 and
works without problems because the API schemas are not being used to
validate APIs as of part 2 of bug 1315575.

The only significance of "menusInternal" is that the namespace is
defined in browser/components/extensions/ext-browser.json,
implemented in browser/components/extensions/parent/ext-menus.js
and used by browser/components/extensions/child/ext-menus.js

MozReview-Commit-ID: 2ACpn595QZQ

--HG--
extra : rebase_source : f3e16486168dfb0baa56dda7ccf591855bbe90bb
2018-08-03 11:09:38 +02:00
Narcis Beleuzu
d9ee6ddde6 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-10 19:06:15 +03:00
Rob Wu
af1d77cbb8 Bug 1480993 - Remove unused extensions.sidebar-button.shown pref from tests r=mixedpuppy
This pref was removed in bug 1387081, when the sidebar-button started to
be shown by default. I have also removed the end of the test that
removed the button, since these were attempts to restore the default
state. At the inception of the tests, the default state is to not show
the button, but now the button is to be shown by default.

Differential Revision: https://phabricator.services.mozilla.com/D2954

--HG--
extra : moz-landing-system : lando
2018-08-09 13:54:41 +00:00
Tom Schuster
5e708d06c1 Bug 1408129 - Treat webextension commands as user input. r=aswan
--HG--
extra : rebase_source : ee6c11f919ce92381bbd95672a5acd0bd6e99f12
2018-08-09 23:15:19 +02:00
Noemi Erli
be6ab34c54 Merge mozilla-central to inbound. a=merge CLOSED TREE
--HG--
extra : rebase_source : 691b5b30b6c3b2ddece605c045ad913e466fdbab
2018-08-10 00:35:58 +03:00
Brian Grinstead
abf1620630 Bug 1479125 - Migrate calls that expect an element to be returned to use element variation firstChild etc to firstElementChild etc;r=Paolo
This allows the JS to work in HTML documents, where whitespace is preserved. In XUL
documents, whitespace is ignored when parsing so text nodes are generally not returned.

The following changes were made, with manual cleanups as necessary (i.e. when firstChild actually
refers to a text node, or when firstChild is used in a loop to empty out an element):

  firstChild->firstElementChild
  lastChild->lastElementChild
  nextSibling->nextElementSibling
  previousSibling->previousElementSibling
  childNodes->children

MozReview-Commit-ID: 95NQ8syBhYw

--HG--
extra : rebase_source : 186d805f7a2a56694dda9032aceac2dfe5424753
2018-08-08 15:22:53 -07:00
Rob Wu
5bb726572c Bug 1280370 - Allow any scheme in targetUrlPatterns r=mixedpuppy
MozReview-Commit-ID: KupQIiAkz0h

--HG--
extra : rebase_source : 25adaca58bdea7ee911aac9496c87f7f2ebd9bf2
2018-07-24 17:26:23 +02:00
Jonathan Kingston
9b7fb2f20c Bug 1362034 - Have addTab() provide the correct triggering principal. r=ckerschb r=Gijs
Reviewers: ckerschb!, Gijs!

Tags: #secure-revision

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2046

--HG--
extra : source : 44b25dea67d2ed079e17057ab619d827e9983400
extra : amend_source : 5742820277e0269b6f5d42b1abd98fd9b228ac4a
extra : histedit_source : 790bd2490333e4d8fea7774d036eafbc2fc329b9
2018-07-06 15:14:54 +01:00
Jonathan Kingston
2f0987a202 Bug 1362034 - Tests for addTab() to provide the correct triggering principal. r=ckerschb r?=gijs
Summary: Depends on D2046

Reviewers: ckerschb!, Gijs!

Tags: #secure-revision

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2047

--HG--
extra : source : 33884d05cc94463950b31fab1fd2f37ada9becef
extra : intermediate-source : 72471adb75d5ec3dc2b0c8f972a6f1f26bfd3ae2
extra : histedit_source : f384cbab58401575afc3443c9a431b73cff806d4
2018-07-06 21:16:29 +01:00
Rob Wu
fe2be1dd11 Bug 1320462 - Support access keys in extension menus. r=mixedpuppy
MozReview-Commit-ID: GsLE3PwNeiC

--HG--
extra : rebase_source : d34b20a2e6ef81623564fd1774a034ab8af9063e
2018-08-06 16:58:21 +02:00
Rob Wu
613a40ff15 Bug 1416103 - Re-enable browser_ext_omnibox.js everywhere r=aswan
Likely fixed by the patch for bug 1417052

Ran the test with --repeat=50 on Linux and did not observe any failures.

MozReview-Commit-ID: FuMo8jdgJCn

--HG--
extra : rebase_source : 2a296cc7817607d352bc56b5b200da81d3e26bf0
2018-08-06 11:24:20 +02:00
Paolo Amadini
5eb83a58d3 Bug 1482610 - Part 2 - Move the remaining attributes and remove the sidebar broadcasters. r=jaws,mixedpuppy
This also fixes unintended behavior for which clicking the selected item in the sidebar selector would hide the sidebar.

Differential Revision: https://phabricator.services.mozilla.com/D3145

--HG--
extra : source : 1070e943ab79f6c46fd6518bc3695b1bee3dfd48
2018-08-14 15:18:25 +01:00
Paolo Amadini
b894ded700 Bug 1482610 - Part 1 - Move the sidebar title and URL from the broadcasters to a JavaScript object. r=jaws,mixedpuppy
The immediate goal is only to remove the broadcasters, so we still require the labels to be set manually on the "toolbarbutton" and "menuitem" elements. Generating these elements programmatically from the new SidebarUI.sidebars object, both for built-in sidebars and extensions, can be a future improvement.

The autoCheck attribute is also unnecessary since it is only intended for the menu items, and they are already properly updated after their command is invoked. Since the attribute was written with the wrong capitalization, it already had no effect.

The persistence of the label of the sidebar selector is also unnecessary since it is already set on startup. Removing this does not seem to cause any additional flickering.

Differential Revision: https://phabricator.services.mozilla.com/D3143

--HG--
extra : source : ef15c7fe957fd48be8a963ab16ddd5a172fe987d
2018-08-14 15:18:03 +01:00
ExE Boss
f0cad9e60c Bug 1371951 - Make browser-style checkboxes and radio buttons handle style themselves. r=mixedpuppy, bwinton
This removes the requirement for browser-style checkboxes and radio buttons
to be followed by a label since the reason why this was originally done
no longer applies because bug 418833 made it possible for checkboxes and radio
buttons to handle styling themselves rather than requiring a label::before
element.

--HG--
extra : rebase_source : 61957bd667b509e8769b86de7f783472d801bb0f
2018-02-17 17:00:00 +01:00
Jonathan Kingston
c24e0873da Bug 1466801 - Flipping disallowInheritPrincipal to be allow. r=ckerschb r=gijs
--HG--
rename : browser/base/content/test/general/browser_utilityOverlay.js => browser/base/content/test/contextMenu/browser_utilityOverlay.js
extra : source : a7bdcc1e1373724effb0bec2d80eb9c63ae782a1
2018-07-16 10:17:51 +01:00
Kris Maglione
06e3d470ae Bug 1357487: Enable OOP extensions by default on all platforms. r=aswan
MozReview-Commit-ID: L2Pm1frQbmo

--HG--
extra : source : e5423d29aaf0b711e02b68b7340a2297dd6bfe16
extra : intermediate-source : ef1550969466fbe9049ee922735f020af82f66d6
2018-07-25 10:29:20 -07:00
Bogdan Tara
2805a16972 Backed out changeset ef1550969466 (bug 1357487) caused perf regressions & author didn't justified them CLOSED TREE 2018-08-03 16:15:42 +03:00
Rob Wu
0360fe3b9c Bug 1398542 - Add test coverage for video/audio context menus r=mixedpuppy
MozReview-Commit-ID: 22VB0Jltj56

--HG--
extra : rebase_source : 98d56e06c4e217816116f1f9e8e47f00d5189677
2018-08-01 18:20:17 +02:00
Noemi Erli
048f87627e Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-02 12:03:09 +03:00
Noemi Erli
8f66a71e70 Merge inbound to mozilla-central. a=merge 2018-08-02 11:54:46 +03:00
dvarga
956d57e7f2 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-08-02 01:26:29 +03:00
Rob Wu
426550290d Bug 1446956 - Test that activeTab is not granted for bookmarks menu r=mixedpuppy
This ensures that the check that was introduced by bug 1370499 still
continues to work even though it was refactored by the previous commit.

MozReview-Commit-ID: GdbIPA6vxIB

--HG--
extra : rebase_source : 9246a1d6855de45eca8de5ee806d3a3e5ab7f0be
2018-07-19 16:35:22 +02:00
Rob Wu
13e9ee22fa Bug 1446956 - Grant access to the clicked tab in menus.onClicked r=mixedpuppy
MozReview-Commit-ID: 3mVWOEcZFYn

--HG--
extra : rebase_source : aec91b4c8b0770208ca7ce9972d1fcf877d53bb1
2018-07-18 22:04:58 +02:00
alwu
c3ae952e6e Bug 1466926 - part3 : add test. r=kmag
MozReview-Commit-ID: 50Eo65ZFkhF

--HG--
extra : rebase_source : d5f01b7936abeaffc5dc20e8448c7ff0cc7fcf6f
2018-07-10 14:29:22 -07:00
Rob Wu
2edcbfa7c8 Bug 1417052 - Use unique keyword in browser_ext_omnibox.js r=aswan
Manually verified using the STR from
https://bugzilla.mozilla.org/show_bug.cgi?id=1417052#c47

I am not re-enabling the test by default because the same test file is
reported to have another intermittent (bug 1416103).

MozReview-Commit-ID: 1xsyjMMby1H

--HG--
extra : rebase_source : 67080c8d7d7d804bf66aa40b577486c68dcaeb4b
2018-08-01 13:49:27 +02:00
Rob Wu
9287b6789f Bug 1477271 - Require "search" permission for search API r=aswan
And re-enable the test_ext_all_apis.html test to ensure that new APIs
are only available by default if the contributor really intents to.

MozReview-Commit-ID: FWIKybrk0EE

--HG--
extra : rebase_source : 58c5bd98ddb59be74b9454995cbbd3edef6c45f9
2018-07-31 20:14:03 +02:00
Rob Wu
6fd8625b04 Bug 1454627 - Fix timing issue in browser_ext_user_events.js r=mixedpuppy
The hard-coded wait exists to avoid a test failure caused by a
non-functional click event in an options browser. However, that
still does not get rid of the intermittent failure.

To really avoid the timing issue, check whether onclick was fired
after supposedly triggering a click, and if not, wait and retry.

MozReview-Commit-ID: 9eg6sz1s1e3

--HG--
extra : rebase_source : 8945f2597beb99e9c5d03c08bc054692960e6281
2018-07-31 16:58:41 +02:00