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
I spoke to Marco about this and it turns out the problem is due to using PlacesUtils.history.insertMany together with
PlacesTestUtils.visitsInDB. Calling the former to insert the visits and then immediately calling the latter to verify
them can result in the latter reading a snapshot of the places DB that is not up to date. The fix is to call
PlacesTestUtils.addVisits which will not return until everything is finished up and will therefore not cause
PlacesTestUtils.visitsInDB to possibly read an old snapshot.
MozReview-Commit-ID: GebqORQI0Co
--HG--
extra : rebase_source : a52b9354557f7bcf4f94ad2b06693ae8f81b87ab
It is helpful to have a slot which never has a token, so that the
absense of a token can be asserted in unit tests.
Add a third token that is always empty, and update a number of unit
tests to check for it.
MozReview-Commit-ID: 4apvRRhZJus
--HG--
extra : rebase_source : cd3bb819bcf66c769f36a428ed26ea8fa6c68a26
This applies the following changes:
- store a weak reference to the browser element in the WebNavigation.jsm Manager's map
of pending CreatedNavigationTarget messages
- when a CreatedNavigationTarget message is received from a sourceTab
for a created window that is not currently tracked in the map
(e.g. it has been immediately closed), the message received from the sourceTab
is not saved in the map of the pending CreatedNavigationTarget (and a message
is logged in the console to make easier to investigate issues related to discarded
CreatedNavigationTarget events).
- adds an additional assertion to the related test case to ensure that no CreatedNavigationTarget
message is still pending in the WebNavigation/jsm's Manager.
MozReview-Commit-ID: FijQ8IqiY8L
--HG--
extra : rebase_source : cd3c072301a1eb24de368c655a96891dd1287c7b
This changes fixes the regression introduced by Bug 1355120 and adds a new
test case which contains a browserAction popup which open and immediately
close a new window and ensure that the received onCreatedNavigationTarget
is the expected one.
MozReview-Commit-ID: JIcVCpBTpxj
--HG--
extra : rebase_source : 37a7db29fa91d0e3f0593f7d5d996ccd3fba719d
It is helpful to have a slot which never has a token, so that the
absense of a token can be asserted in unit tests.
Add a third token that is always empty, and update a number of unit
tests to check for it.
MozReview-Commit-ID: 4apvRRhZJus
--HG--
extra : rebase_source : 13bfac22fcf4dfbdbcbff25254785e53cbd25920
This option works in Chrome and is documented to work in Firefox but seems
to have never been implemented.
MozReview-Commit-ID: KOu8TRaCCzL
--HG--
extra : rebase_source : 98605a64c12102e5c09acfd5bfef410cb75d5ba0
I had to add a mochitest because PlacesUtils.history.insertMany cannot create hidden redirects.
I also added a support for the "reload" transition while I am here.
MozReview-Commit-ID: ECQp6pW2r8v
--HG--
extra : rebase_source : d4456d32a57cdadec8ca383a2b09dee29e20b10f
In the end the webextensions tests that test devtools should be able to load devtools
apis in the same way as devtools tests. This allows to remove the gDevTools getter on
the devtools shim, which makes the paths that can potentially initialize devtools easier
to predict.
MozReview-Commit-ID: AHokH12ygKI
--HG--
extra : rebase_source : 9166f477e2d38351e836aa14c53a420bd9cbddf7
This applies the following changes:
- store a weak reference to the browser element in the WebNavigation.jsm Manager's map
of pending CreatedNavigationTarget messages
- when a CreatedNavigationTarget message is received from a sourceTab
for a created window that is not currently tracked in the map
(e.g. it has been immediately closed), the message received from the sourceTab
is not saved in the map of the pending CreatedNavigationTarget (and a message
is logged in the console to make easier to investigate issues related to discarded
CreatedNavigationTarget events).
- adds an additional assertion to the related test case to ensure that no CreatedNavigationTarget
message is still pending in the WebNavigation/jsm's Manager.
MozReview-Commit-ID: FijQ8IqiY8L
--HG--
extra : rebase_source : 20e5c27ba18f7f05f9076db19091f1c1153a6c39
This changes fixes the regression introduced by Bug 1355120 and adds a new
test case which contains a browserAction popup which open and immediately
close a new window and ensure that the received onCreatedNavigationTarget
is the expected one.
MozReview-Commit-ID: JIcVCpBTpxj
--HG--
extra : rebase_source : 0966eba7c752068522400b032a8018b96e9dcda9
All of the information needed for an extension to watch for tabs moving in and out
of reader mode is already available in the onUpdated event. This adds some asserts
to the existing test to check that this information is accurate.
MozReview-Commit-ID: 7OkR933MUPl
--HG--
extra : rebase_source : cf7a6bae5b7a4b6678b7fb1cb19027fa0ab97d71
Currently if there is no default icon at the specified size, the default icon
falls back to the light text icon at that size. This is wrong in two ways:
First, the default theme uses dark text, so it should fallback to the dark icon
Secondly, authors expect the unsized default_icon to be used if specified
This patch fixes both of these issues, so that the default icon first falls back
to the unsized default_icon, and then only if that is not specified falls back
to the dark icon
MozReview-Commit-ID: C3RRTKhYq6r
--HG--
extra : rebase_source : dc10f5c65c763412edbe467bb75aeb4fbcd32ffc
This WebExtensions API allows to install, remove, and query installed
PKCS#11 modules as well as to query the the status of available PKCS#11
"slots" for a given module.
Reuses the native application manifests from the "Native Messaging" API,
but using the "pkcs11" type rather than the "stdio" type.
All calls expect an application name, which is not the PKCS#11 friendly
name (the "description" field in the manifest file is used for that) but
instead the application name in the manifest file.
MozReview-Commit-ID: 8dHr5QfEaXv
--HG--
extra : rebase_source : 196ff66a8987be1b21463b725a2e207396e5eb0a
This WebExtensions API allows to install, remove, and query installed
PKCS#11 modules as well as to query the the status of available PKCS#11
"slots" for a given module.
Reuses the native application manifests from the "Native Messaging" API,
but using the "pkcs11" type rather than the "stdio" type. Update the
code for the Native Messaging API to ignore any manifests for the
"pkcs11" type.
All calls expect an application name, which is not the PKCS#11 friendly
name (the "description" field in the manifest file is used for that) but
instead the application name in the manifest file.
MozReview-Commit-ID: 8dHr5QfEaXv
--HG--
extra : rebase_source : 00cc9c6d8433460c93f9c579f1696e4e17d6d3a0
This adds two properties to the Tab object:
- isArticle indicates whether the document in the tab is likely able to be
rendered in reader mode.
- isInReaderMode indicates if the document in the tab is being rendered in
reader mode.
It also adds a toggleReaderMode() which toggles a tab into and out of reader mode.
There is also a new case in which tabs.onUpdated will fire. When the isArticle
status of a tab changes, an onUpdated event will fire with data {isArticle: boolean}.
MozReview-Commit-ID: AaAQ0V5qm2Z
--HG--
extra : rebase_source : f9cbed6dff56781ecd86281cb46f23f0ec8aecf6
This adds two properties to the Tab object:
- isArticle indicates whether the document in the tab is likely able to be
rendered in reader mode.
- isInReaderMode indicates if the document in the tab is being rendered in
reader mode.
It also adds a toggleReaderMode() which toggles a tab into and out of reader mode.
There is also a new case in which tabs.onUpdated will fire. When the isArticle
status of a tab changes, an onUpdated event will fire with data {isArticle: boolean}.
MozReview-Commit-ID: AaAQ0V5qm2Z
--HG--
extra : rebase_source : 579fccb76358dc0d333409ed81669cf45576e67f
We weren't removing the 'open' attribute from the anchor if the transition didn't complete.
This patch fixes this by moving the addition of 'open' into _transitionViews, and its removal into
_cleanupTransitionPhase.
MozReview-Commit-ID: TS0CcwsHVN
--HG--
extra : rebase_source : 1bdace324f22ee95002024fe68b572a16dd25aac
If the back button is used to navigate a tab backwards in its history, and then the tab is closed,
the current implementation of sessions.getRecentlyClosed does not take this into account and
just uses the last item in the tab history for the values returned for the tab. This patch fixes
this by using the values for the current position of the tab in its history.
MozReview-Commit-ID: LcgtA5FqVWi
--HG--
extra : rebase_source : 3b8cd840fd30305471feec643f77d57378bd40d7
The bug was failing because we were calling the server but the connection was already closed.
In order to prevent such things, we check the number of nodes of the tree, and if it has only
one, then we wait on a mutation that will ensure that server calls are done.
MozReview-Commit-ID: 7kHAkYs2I4K
--HG--
extra : rebase_source : 0204960d4ea3cca8bd9614908a730a0d4d6b4e69
Currently tabs.onActivated (for the tab that becomes active after a tab is removed) fires before
tabs.onRemoved (for the tab that was removed). This is neither the order in which Chrome fires
these events, nor is it the order in which the internal TabSelect and TabClose happen in Firefox.
This bug fixes this so tabs.onActivated fires *after* tabs.onRemoved.
Note that this does introduce an issue in in-process mode, where window.close() will not
trigger a tabs.onRemoved event for the window, but Kris says "Meh" about that.
MozReview-Commit-ID: CrFR3jqL2u5
--HG--
extra : rebase_source : 5cc3d2a138bf812d13779e8ca1188b89ddbcdcc1
This adds a loadReplace option into the updateOptions object for tabs.update()
which, when set to true, will cause the loading of the new URL to replace the
current URL in the tab's history.
MozReview-Commit-ID: KZTuEl7cgb0
--HG--
extra : rebase_source : 24f006fe197f56b3102cb00e226d53036b9ba93b