This patch requests a bit longer test timeout for browser_ext_devtools_panel.js, similarly
to other tests that open/close the devtools toolbox multiple times, because it often
timeouts on linux32 debug builds after we added a couple more "toolbox open/close" cycles
to test Bug 1394750 changes (and also made the devtools theme API tests more readable
by splitting it from the test case that verifies the rest of the devtools panel API).
MozReview-Commit-ID: 3JRWobPRwr5
--HG--
extra : rebase_source : 352fd4870048afa789d10afd2dd05bad9daa87ef
Use a more specific entry point for the test than
"http://mochitest.test:8888" to make sure that the test is only started
once, when the test opens a tab with the entry point.
MozReview-Commit-ID: 7iAFREDuACu
--HG--
extra : rebase_source : 6ab46b1114dc824f29d0bf21ffa784cd14651447
Extension ports are automatically closed when the message manager of
the source is destroyed. When a tab is detached from a window, its
frameloader is moved to the new window and the original message
manager is destroyed.
Bug 1445537 started listening for SwapDocShells events, but that only
works for the first swap (e.g. detaching a tab once). To avoid early
disconnection of the port, we should continue to subscribe to
SwapDocShells events.
MozReview-Commit-ID: G2ZYAhNyHIL
--HG--
extra : rebase_source : 9f888482e63d2768adf3dbd1c484a483dc307b2b
Contexts for active extension views are kept in a Set on the owning extension.
That list is meant to be kept current, with views added and removed as they're
created and unloaded. A refactoring at some point in the past, though, changed
that so that we only cleaned up parent views at extension shutdown, not at
view shutdown.
MozReview-Commit-ID: FW8KHPOD9qc
--HG--
extra : rebase_source : fab255ba2fb5ee55be41c252c89930d38f6edbe8
extra : amend_source : 54863d79a1d571a7354aa15f74e2fc4448297777
If commands are used with the page action panel, they will toggle open or
closed. We need to keep a handle on our custom panel so we can close it.
MozReview-Commit-ID: JfxwlyK8g8g
--HG--
extra : rebase_source : 25b4fbe794040d6769fa498cee5fcad154e002f9
Now that WebExtensions run OOP in Windows by default, and we have no intention
of going back, there's no need to run an extra set of in-process tests for
them.
MozReview-Commit-ID: t8ryuuNFHe
--HG--
extra : amend_source : 90e006ca618206a943991b14cb11779baa7b8934
Calling into the Photon PageAction API to update a property is orders of
magnitude more expensive than the simple DOM-based updates we used previously.
To make matters worse, a lot of our caching was removed during the migration,
and the Photon API introduces a lot of duplicated work when selecting icons.
This patch caches the last known state for each property to avoid calling into
the Photon APIs to update each property more than necessary, and removes the
extraneous preferred icon size calculations that the Photon code already
duplicates.
MozReview-Commit-ID: LjPPxolmcd6
--HG--
extra : rebase_source : 70bce5b1460c93cc738999b1e167eb17a39259b1
The shims that this rule tests for no longer exist.
MozReview-Commit-ID: DMgP7Hczavc
--HG--
extra : rebase_source : 765ddd5c62c9449c07ed050e44d86a3bd5c0ae64
extra : amend_source : 627a7694ac07182200f876901ded7a34721cd228
Now we're loading the sizemode attribute earlier, doing this on load stops
working.
MozReview-Commit-ID: ToiJiYrvFw
--HG--
extra : rebase_source : 48ad80e5535ecc5f7c8c8297f417f797deddc017
extra : source : 80194b5bf0e7bbcccf727d2fec140e747ebd0949
extra : histedit_source : 2b7755fece2a564fc806369280559c8829d3d486
Ensure remoteWebProgress is initialized for remote browsers. Includes devtools fix from jryans.
MozReview-Commit-ID: Ce3TzwkNnyi
--HG--
extra : rebase_source : 0f2bcb96ef04f4eaee447180dc21400dca3bf410
Add filtering of urls, properties, window and tab id to onUpdated events to
help reduce the quantity of update events that are dispatched.
MozReview-Commit-ID: J8Rh9uEt1gW
--HG--
extra : rebase_source : df821e63a3029e9970f6174f8132f30003b77221
Regression from bug 1398713. Before that, we reloaded the entire webext-panel.xul if the
sidebar changed. This verifies we don't reload unecessarily as well as discards
the browser to force a runtime disconnect for the extension if it does change.
MozReview-Commit-ID: LuYxmj9mSb7
--HG--
extra : rebase_source : 9839d7b96195f2323328d1a37c3d946032bbb652
This test has been disabled because it was failing intermittently with a pretty high
frequency on the Windows platform, the reasons behind the failures have been fixed
in Bug 1435100.
MozReview-Commit-ID: FNJqocBcxnf
--HG--
extra : rebase_source : f5fd1392bc53f137c8e48e433fddd103af74eaad
We need a static disable event so we can handle shutdown
of extensions using hidden tabs. This allows us to handle
shutdown when the extension has not yet used the API (thus
the ext-tabs api has not loaded).
MozReview-Commit-ID: BxV5PmbHJ8o
--HG--
extra : rebase_source : 78dd8b6e6b6ee1b09d446545dc8b38e32d7e9969
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:
1. GlobalObject::CallerType(), that is ultimately passed to
nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
to decide whether to copy mIterationComposite/mComposite to
KeyframeEffectParams.
GlobalObject::CallerType() can now be different than the target window's one,
if the caller has the system principal and the target is web content, and
in that case nsDocument::IsWebAnimationsEnabled there always returns true
while Web Animations can be disabled on web content.
honoring the mIterationComposite/mComposite properties is OK, since it just
changes the animation behavior, and this is disabled by default until
remaining spec issues are resolved.
2. GlobalObject::Context(), that is ultimately passed to
KeyframeUtils::GetKeyframesFromObject and used while extracting information
from passed-in keyframe object, with iterable/iterator protocols.
Performing that operation in the caller side is okay, since the same thing
can be done on caller, and the operation doesn't perform any GCThing
allocation on the target window global.
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.
MozReview-Commit-ID: De4enbjux3T
--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:
1. The target window global is used for most operation:
* KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
global instead of current global.
* KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`
In Xray case, Web Animations API can be disabled on web content
(currently disabled on beta/release by default), and in that case some API
won't work even it's triggered from WebExtensions, but it should be fine.
2. GetKeyframesFromObject is executed in the caller's compartment to access
the passed-in JSObject that is keyframe, with iterable/iterator protocols.
This operation doesn't perform any GCThing allocation on the target window
global.
See the comment on "Address test failures caused by bumping timer precision to 2 ms"
for more details.
MozReview-Commit-ID: LrsucEPdZIo
--HG--
extra : rebase_source : 8147c034f7dc93f678eebc80b0afabf55729d804
There are a few different reasons why tests needed updating (not an exhaustive list):
- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.
In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648
An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)
In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.
MozReview-Commit-ID: J59c7xQtZZJ
--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
This patch fix a type in the tests related to tabs.insertCSS/removeCSS,
the test function is actually named browser.test.notifyFail.
MozReview-Commit-ID: 8DpOFBpm795
--HG--
extra : rebase_source : 86a4977659cdbb9717b6411bd37142ef60ec9e55
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
- Work-around in browser_ext_menus_events.js for bug 1428213
- Fix indentation issues (eslint)
- Hide the "pageUrl" property for bookmark menu events
(fixes test failure in test_bookmark_contextmenu).
MozReview-Commit-ID: 4YHJci0J7Rh
--HG--
extra : rebase_source : 3879e843bd2826fcd34dbd41708d570024e681e8
This test ensures that the menu events will always be fired in the
natural event order.
Two menus are tested:
- A context menu in the page.
- The tools menu.
MozReview-Commit-ID: 4sLyvgMYMtE
--HG--
extra : rebase_source : 9837661f034530b63c9cbbbb3104fb6367f513a8
This commit lifts the restriction that onShown is only fired for
extensions with a visible menu item.
MozReview-Commit-ID: Ao4MgBoRWLR
--HG--
extra : rebase_source : c1acd1bcbfdcc6ef4bfaf199f3f016dde71ad2e5
- Adds most of the OnClickData properties to the onShown event parameter
(except for menu-specific properties such as parentMenuId / checked).
- Add tests to verify the values of these properties.
MozReview-Commit-ID: 7705sJyAOIJ
--HG--
extra : rebase_source : 8948ea20129cfd1c34653a3cbe9b36cebd6fa00d
Together with the previous patches that introduced menus.onShown,
this enabled extensions to update/remove menu items after a menu
has been shown.
At this point, it is not yet possible to add a menu item if an
extension has not shown a menu item before; this can be added later.
MozReview-Commit-ID: E0JrE9gd4gS
--HG--
extra : rebase_source : 0d21c369eb17b3a819603f27af8d9f9fccf5b783
Previously, there was no guarantee for the uniqueness of the ID.
Now the ID is unique, and always set.
See https://bugzil.la/1358213#c6 and #c7 for examples of collisions.
MozReview-Commit-ID: 7CHP6tWFDUg
--HG--
extra : rebase_source : a585dcfd3a83eb590de9b69a02dba8b4bb1b0a0c
This commit adds the bare minimum to support the onShown and onHidden
methods in the contextMenus and menus API (plus tests).
The onShown event data may be extended in a separate commit, to make it
easier to see how the additional properties are reflected in the tests.
MozReview-Commit-ID: 20VJS2YLhTN
--HG--
extra : rebase_source : 1fe9985b2e5daa1be455e07ccf58e36e6d9fe508
Most close*Menu methods in browser tests allow itemToSelect to be null.
Some did not.
Now they do (after this commit)
MozReview-Commit-ID: 2jSGAi2R3ZD
--HG--
extra : rebase_source : 897d4a66f5b1da8027180f85c5f5f5284734e860
There are three changes:
1. Adds a print progress listener to tabs.saveAsPDF() in ext-tabs.js so that the
'saved' or 'replaced' status is not returned until the PDF file has been saved.
2. Adds four more "edge" properties to the pageSettings object to allow positioning
of the page headers and footers.
3. Adds automated tests for tabs.saveAsPDF() in browser_ext_tabs_saveAsPDF.js that
cover all returned statuses: saved, replaced, canceled, not_saved, not_replaced.
MozReview-Commit-ID: iljvT8wp11
--HG--
extra : rebase_source : 081f8b6ed56ecaa5f5f5414a11f57b143c0fd19e
There are three changes:
1. Adds a print progress listener to tabs.saveAsPDF() in ext-tabs.js so that the
'saved' or 'replaced' status is not returned until the PDF file has been saved.
2. Adds four more "edge" properties to the pageSettings object to allow positioning
of the page headers and footers.
3. Adds automated tests for tabs.saveAsPDF() in browser_ext_tabs_saveAsPDF.js that
cover all returned statuses: saved, replaced, canceled, not_saved, not_replaced.
MozReview-Commit-ID: LMTjKDjBwY3
--HG--
extra : rebase_source : 3fc661c737ee5800d9d40e51ecafc11a946e8780
The return value from Cu.import() does not include lexically scoped
symbols so stop using it here. Also stop using Extension.generate()
while we're here.
MozReview-Commit-ID: HnX3RGgDHbR
--HG--
extra : rebase_source : b4e238f2a5f1c9dce838b4dd70447edd9f401c10
This updates browserSettings so that calling set and clear return false, rather than undefined,
for read-only settings. It also returns "not_controllable" rather than "controllable_by_this_extension"
for levelOfControl from calls to get for read-only settings.
MozReview-Commit-ID: 9c0bKDaYIC7
--HG--
extra : rebase_source : c47c97bcc19095bf1945e111e13e2a8f02e98799
This introduces a new property to WindowTracker (on desktop only) called topNormalWindow
which returns the topmost window which is not a popup window. That property is then used
by tabs.create to identify the top "normal" window when a windowId is not passed to it.
Bug 1421709 has been filed to look for other opportunities to use topNormalWindow
in place of topWindow in our codebase.
MozReview-Commit-ID: DcV93wO6FoV
--HG--
extra : rebase_source : 7c7be7c364cc627d385929a2c9fd2dee757bf835
The recent failures all seem to be on the assertion that lastAccessed of tab 1 is
later than the test start time. It's possible that things happen so quickly that
lastAccessed of tab 1 is the same as the start time, so this patch changes the
comparison to be a <=.
MozReview-Commit-ID: 67CVQPj1ShM
--HG--
extra : rebase_source : c370422f3c9e54bbae8b4e7827c671c5a784ce7b
This includes removing the "web-extension-preferences-replacing" and "web-extension-preferences-replaced"
notifications as they are no longer needed.
MozReview-Commit-ID: IjNf4BImgas
--HG--
extra : rebase_source : a48e72c291ebd509d19e9e94196d3600eb7328c4
This patch introduces two changes to the test:
1. It breaks apart the assertion that was combining three tests into individual assertions, so if this does
fail again in the future it will be easier to spot the actual problem.
2. It uses addTab and browserLoaded instead of openNewForegroundTab, which seems to allow the test to wait
long enough before starting the extension.
When I was able to reproduce the failure, after separating the assertions, I found the one that was failing
was the check that tab2.lastAccessed was less than the current time. I believe that the current time was being
recorded too soon, which is why I changed the test to not record the current time until after both tabs have
completed loading. This seems to fix the intermittent locally for me.
MozReview-Commit-ID: I3VoYODwjgz
--HG--
extra : rebase_source : 34729a3ae02e9266cf5aee63de293786403a46e9