Commit graph

499 commits

Author SHA1 Message Date
Kris Maglione
9c000b319d Bug 1313956: Async all the tests. r=aswan
MozReview-Commit-ID: CyNCfEsDD42

--HG--
extra : source : efc9b52a218f7ffd40ba346de74fd846a9059ceb
2016-11-07 21:03:14 -08:00
Kris Maglione
5afec92baa Bug 1315575: Part 3 - Convert ImageData objects at the binding layer, and remove unnecessary content bindings. r=aswan
MozReview-Commit-ID: CjqXRiFcMWp

--HG--
extra : rebase_source : 5e9a839c8193699083e304c27138b876675ea8a7
2016-11-06 17:35:07 -08:00
Wes Kocher
147936ec43 Merge inbound to central, a=merge 2016-11-07 14:00:52 -08:00
Kris Maglione
433c0df4cc Bug 1306797: Dispatch key events to the correct windows. r=me
MozReview-Commit-ID: 2jxb5dnVREu

--HG--
extra : rebase_source : 95c8b75f832c76dad942c4d594ae3855250cd88b
2016-11-06 19:18:24 -08:00
Phil Ringnalda
7f06434292 Merge m-c to m-i
MozReview-Commit-ID: KCA8bY2DowI
2016-11-06 19:16:46 -08:00
Kris Maglione
8b796251b6 Bug 1266510: Try explicitly focusing new browser window before waiting for focus change event. r=me
MozReview-Commit-ID: B3mod2MtA8d

--HG--
extra : rebase_source : 9531fab468c30492efbcf686425918a36e1ed21e
2016-11-06 19:03:03 -08:00
Kris Maglione
ab2c61f94d Bug 1308649: Split browser_ext_windows_create.js into three files. r=me
MozReview-Commit-ID: 5abJw8VEJCU

--HG--
rename : browser/components/extensions/test/browser/browser_ext_windows_create.js => browser/components/extensions/test/browser/browser_ext_windows_allowScriptsToClose.js
rename : browser/components/extensions/test/browser/browser_ext_windows_create.js => browser/components/extensions/test/browser/browser_ext_windows_create_params.js
extra : rebase_source : 6d5385560a1ca89f43b985504fa8f70710fe9eb1
2016-11-06 17:43:47 -08:00
Bob Silverberg
822f3154e2 Bug 1310019 - web extension API : chrome.tabs.query doesn’t get tabs title at first call, r=kmag
Add permission to the active tab on mousedown in ext-browserAction.js

MozReview-Commit-ID: H0oXQElppo7

--HG--
extra : rebase_source : 09ac61c479b57cb487bd81855dd9acae27537f39
extra : source : 935c49da3488b4270cf45447451d6bb0abe3f369
2016-10-31 17:30:16 -04:00
Sebastian Hengst
e9bafabd96 Backed out changeset 15760cbfa77a (bug 1308058) for almost permafailing browser_ext_sessions.js on Linux debug in e10s mode. r=backout a=backout
MozReview-Commit-ID: 6uhHHvTHguG
2016-11-05 11:12:19 +01:00
Bob Silverberg
799141376a Bug 1308058 - Implement sessions.getRecentlyClosed WebExtensions API, r=aswan
MozReview-Commit-ID: 7AKfMil3Dr4

--HG--
extra : rebase_source : a8a6c35e329c699eea523f1dad794e1106681719
2016-10-25 16:09:28 -04:00
Bob Silverberg
7083cbf0d9 Bug 1308058 - Implement sessions.getRecentlyClosed WebExtensions API, r=aswan
MozReview-Commit-ID: 7AKfMil3Dr4

--HG--
extra : rebase_source : 075f74835aff7f9937d3f456714c64b9a31168db
2016-10-25 16:09:28 -04:00
Kris Maglione
9ec833d34e Bug 1308421: Handle MessageChannel responses correctly after docshells have been swapped. r=aswan
MozReview-Commit-ID: HDTrBfdclXd

--HG--
extra : rebase_source : ec09a6772df798982fc2d52153186fd901a3984c
extra : amend_source : da03f0645ee6561497936f7c42d46f941ad2dd77
extra : histedit_source : 0937500d487c46a738c0a2783b04054ec238a940
2016-10-11 21:08:33 +01:00
Kris Maglione
e6b9c2b457 Bug 1307551: Don't attempt to pre-load popup for disabled browserAction. r=bsilverberg
MozReview-Commit-ID: 8imoqD1Xoja

--HG--
extra : rebase_source : 8f0fa63b813f77bc8cde28aa1878c880ac96a3df
extra : amend_source : dee66aef3c55b737fb8f946d9184fc82794f0ff5
2016-11-01 09:41:30 -07:00
Kris Maglione
e9c3a589bb Bug 1312690: Lazily initialize extension APIs. r=aswan
MozReview-Commit-ID: 2ofzT6wPvus

--HG--
extra : rebase_source : 462e3eca2a9750fb07ad753322e86bc1494a8b4e
2016-11-02 19:21:04 -07:00
Shane Caraveo
cb4c301312 Bug 1273138 fix WebRequest for background pages, r=kmag
MozReview-Commit-ID: DEW9anMmKi2

--HG--
extra : rebase_source : 7d82d1000473b2530d6144987a28e35815c11999
2016-11-02 09:30:50 -07:00
Ryan VanderMeulen
a41f7d1058 Merge autoland to m-c. a=merge 2016-10-29 09:12:45 -04:00
Andrea Marchesini
0467141ad5 Bug 1302697 - Containers and WebExtensions - part 3 - getAllCookieStores, r=kmag 2016-10-28 10:16:32 +02:00
Andrea Marchesini
c119e65ac0 Bug 1302697 - Containers and WebExtensions - part 1 - Tab API, r=kmag 2016-10-28 10:15:42 +02:00
Eric Rahm
52e9f58e98 Bug 1312901 - Part 2: Use nsIArray for URL argument when opening a window. r=Gijs
This updates the URL argument to use an nsIMutableArray instead of an nsIArray.

MozReview-Commit-ID: 45kvKCBYNK6
2016-10-27 14:22:14 -07:00
Rob Wu
ca2c1cf947 Bug 1299411 - Pass port parameter to port.onMessage r=kmag
This should have been a part of bug 1298810, but that only set the
argument for native messaging ports, which does not use Port from
ExtensionUtils. The port parameter must also be included in runtime's
Port.onMessage to avoid regressions when the port implementations are
unified and native messaging starts using runtime's Port.

Note that starting from this commit, multiple onMessage listeners
receive the same (cloned) message instead of a new clone per listener.
This is a side effect of using `fire.withoutClone` instead of `fire`:
`fire` clones all parameters, but ports are not cloneable so we have
to use `fire.withoutClone` instead. This change with regards to message
cloning is fully compatible with Chrome's messaging API (which also
passes the same message object to all `port.onMessage` calls).

MozReview-Commit-ID: AUDuUKHkXCM

--HG--
extra : rebase_source : b91d701bba21f376935961a6eeb1a8489ac5591b
2016-09-24 11:34:26 +02:00
Carsten "Tomcat" Book
c1f7613ca2 Backed out changeset 0fd006bf6f9d (bug 1308058) for timeouts in browser_ext_sessions.js
--HG--
extra : rebase_source : d06e03178e4940618d0c42de2e7da26e485f23c0
2016-10-28 15:45:29 +02:00
Rob Wu
e668502481 Bug 1287007 - Fix timing issue in browser_ext_windows_create_tabId.js r=billm
When tabs.onUpdated is called before the promise of windows.create
resolves, the test fails.
This test failure was observed on almost every try run with non-e10s,
and sometimes (rarely) with e10s.

MozReview-Commit-ID: 3znCP1uAUSB

--HG--
extra : rebase_source : ec150b83f85a50f75eda2a0e41f3a60611625046
2016-10-21 01:35:03 +02:00
Rob Wu
2c28b34d3b Bug 1287007 - Fix timing issue in browser_ext_contextMenus.js r=billm
MozReview-Commit-ID: D7No2zFUWjf

--HG--
extra : rebase_source : 70dee95902fb580bdca2c1cf33675fd13346f22f
2016-10-12 01:10:33 +02:00
Rob Wu
9dfc705076 Bug 1287007 - Adjust state test in browser_ext_windows_update.js on Linux r=kmag
The test/browser/browser_ext_windows_update.js test fails on Linux.

The window ID is not expected to change, add assertion for it to
eliminate causes for test failures.

Ultimately, it turns out that the test failure is caused by a defect
in the implementation, not the test itself, see bugzil.la/1307759

MozReview-Commit-ID: Lo8IIvcfYQ2

--HG--
extra : rebase_source : 12ffc9c2d545723b012b6c5dcf216e7ef34e1790
2016-10-03 01:13:32 +02:00
Rob Wu
3a2af37b59 Bug 1287007 - Fix timing issue in browser_ext_tabs_onUpdated.js r=billm
Reload about:blank tab after opening it and registering the
`tabs.onUpdated` event. This is needed because about:blank loads very
fast, before the callback of `tabs.create` is invoked. This effect is
amplified by the fact that the APIs are now proxied.

MozReview-Commit-ID: DgPtIqHSUDx

--HG--
extra : rebase_source : afe6ec984bed06f47c24e39fee6fa7c757c3dde3
2016-10-01 01:07:22 +02:00
Rob Wu
3be3ab8f88 Bug 1287007 - Remove contextMenusInternal.onClicked r=billm
contextMenusInternal.onClicked is already inlined in context_menus.json.
It should be removed because otherwise the
`browser.contextMenusInternal.onClicked` API would be generated.

MozReview-Commit-ID: LAKd2IGM5GU

--HG--
extra : rebase_source : 60668c2ef75661eefe21ce3135a2b7d7d320cb7b
2016-10-01 00:46:19 +02:00
Rob Wu
3992652f2f Bug 1287007 - Make browser_ext_tabs_executeScript.js reliable r=billm
The ProxyMessenger registers a listener whenever the first addon
starts. Although the map does not have any listeners any more at
the end of the test, the listener itself is not removed because
the message-manager-close notification is not sent for them.

So do not count these persistent message managers in the test.
The actual message managers of interest are those associated with
the (closed) tab.

Note: When the test is run in isolation, it may still fail due
to bugzil.la/1293583. See bug for work-around if you want to test.

MozReview-Commit-ID: IiDHhmvQPcv

--HG--
extra : rebase_source : 3a9332d69be31e34bc704de217c823e2a02dd514
2016-09-15 15:53:03 -07:00
Rob Wu
70ca4c8753 Bug 1287007 - Make window.close in extension pages async r=billm
Test coverage by tabs.onRemoved + window.close() in:
toolkit/components/extensions/test/mochitest/test_ext_tab_teardown.html

MozReview-Commit-ID: 7asg2XGrTaQ

--HG--
extra : rebase_source : 4498725a207e1863bb5a1f0ee58673e6976df1f8
2016-09-13 20:26:18 -07:00
Rob Wu
67b8230b49 Bug 1287007 - Remove .contentWindow from ProxyContext r=billm
MozReview-Commit-ID: ASNigrM07yz

--HG--
extra : rebase_source : e9169090ec8cb1d9822f235faa15516403576dde
2016-09-13 16:02:03 -07:00
Rob Wu
0c66504d77 Bug 1287007 - Fix "onclick" in contextMenus, to child. r=billm
Main thing: Making contextMenus implementation webext-oop compatible.

Preparation:

- Add getParentEvent to ChildAPIManager to allow use of remote events.
- Introduce `addon_parent_only` to "allowedContexts" to only generate a
  schema API in the main process.
- Do not fill in `null` for missing keys if the schema declares a key as
  `"optional": "omit-key-if-missing"`. This is needed for the second
  point in the next list.

Drive-by fixes:

- Ensure that the "onclick" handler is erased when a context closes.
- Do not clear the "onclick" handler in `contextMenus.update` if the
  onclick key has been omitted (parity with Chrome).
- Remove some unnecessary `Promise.resolve()`
- Add extensive set of tests that check the behavior of the contextMenus
  APIs with regards to the onclick attribute in various scenarios.

MozReview-Commit-ID: A5f3AUQzU8T

--HG--
extra : rebase_source : 0464a1aa2387343a6f1d0fcd8fbabfdd1a68b1bb
2016-09-12 18:26:03 -07:00
Rob Wu
fcb710d311 Bug 1287007 - Move part of browserAction and pageAction to child r=billm
And remove redundant `Promise.resolve()` because it is the default
for async functions.

setIcon is not supported on Android, so there was no need to change
mobile/android/components/extensions/ext-pageAction.js.

MozReview-Commit-ID: 94ebaJFxLAi

--HG--
extra : rebase_source : 20466181501b264ba33fc8ab61fdf2bed20f9eef
2016-09-11 04:18:35 -07:00
Rob Wu
bd0fa6844a Bug 1287007 - Only close extension tabs upon shutdown r=billm
In one of the previous patches, the viewType of popup changed from
"popup" to "tab". As a result it was closed by the `page-shutdown`
event handler in ext-tabs.js. This prevents that from happening.

Also added a test that checks whether the options page type is a tab, to
prevent future regressions.

MozReview-Commit-ID: 3Qcf08PgNqb

--HG--
extra : rebase_source : c4b89d122df52a7280ff5818903cb1d8737fb31c
2016-09-08 19:02:56 -07:00
Rob Wu
dce0635037 Bug 1287007 - Use IPC to share viewType, tabId and windowId r=billm
Accessing <browser> in ContentChild does not work when extensions run in
a separate process.

MozReview-Commit-ID: EK0aOYeGaZ5

--HG--
extra : rebase_source : 359cb1f9022b8097d27aa74a30e133c4a7e7c742
2016-09-06 15:25:10 -07:00
Rob Wu
9db4f57609 Bug 1287007 - Fix timing issue in browser_ext_tabs_getCurrent.js r=billm
browser.test.sendMessage does not have enough time to finish
before tabs.remove since test moved to ChildAPIManager for
extension pages, causing the test to time out.

MozReview-Commit-ID: 1mmGZOi9fzm

--HG--
extra : rebase_source : b0d1310f867040f1f7d14b94a95ba364e3902f88
2016-09-06 14:45:58 -07:00
Rob Wu
ff65d297cc Bug 1287007 - Move extension context initialization to ExtensionContent r=billm
This is a simple move of ExtensionContext creation logic to
ExtensionChild.

Before the change, ExtensionContext was initialized as follows:

1. (ext-backgroundPage.js) Create background page
2. (Extension.jsm) document-element-inserted observed.
3. (Extension.jsm) new ExtensionContext + unload observer.

After this commit:

1. (ext-backgroundPage.js) Create background page
2. (ext-backgroundPage.js) emit extension-browser-inserted event
3. (Extension.jsm) Pass global to ExtensionContent + unload listener.
4. (ExtensionContent.jsm) document-element-inserted observed.
5. (ExtensionChild.jsm) new ExtensionContext

The next step is to use frame scripts and synchronize state.

MozReview-Commit-ID: K6mPdq7KQ2T

--HG--
extra : rebase_source : c742dfe89646d6717da134c7408aa5a066107c66
2016-09-05 23:50:11 -07:00
Rob Wu
6023c940a4 Bug 1287007 - Rename "context.type" to "context.viewType" r=billm
"viewType" is more easily searchable and not as ambiguous as "type".

MozReview-Commit-ID: 8sG4qagFCBu

--HG--
extra : rebase_source : 39d76379996e631b9fc33f0c77d565cf302b9df9
2016-09-05 22:26:56 -07:00
Rob Wu
4ec02709a6 Bug 1287007 - Mark all browserAction methods as async r=billm
E.g. browser.browserAction.enable(...).then(...) now works as expected.
Removed a Promise.resolve() because that is the default.

MozReview-Commit-ID: 4Shxtn0rjYH

--HG--
extra : rebase_source : 2f2516686c7d79094fac5ff1176c1c9310f1abe5
2016-09-02 14:22:09 -07:00
Rob Wu
8a87af36f9 Bug 1287007 - Require "async" in schemas to match name r=billm
In the pageAction and browserAction schemas, several methods are
declared with `"async": true` but without a specified callback in the
`"parameters"` object, so callbacks are not allowed. However, when a
callback is proxied, the `ParentAPIManager` will mirror the call by
passing in an extra callback to the proxied API - and break.

This patch fixes the issue by removing uses of async:true.  Also for
consistency between the browserAction and pageAction methods, the
methods that were not declared as async have also been marked as async.

MozReview-Commit-ID: JQqzmTUAotB

--HG--
extra : rebase_source : 62d1cbc4843dd6c792318337158e4311f8df94a4
2016-09-02 03:37:55 -07:00
Rob Wu
ef043e450c Bug 1287007 - Fix timing issue in browser/page action tests r=billm
MozReview-Commit-ID: 9L0ttaq42Ga

--HG--
extra : rebase_source : 0120e0bf68a5d60096454c6dd42b2496a73be3a5
2016-09-02 16:33:32 -07:00
Dave Townsend
5ae97524cb Bug 1312055: Fix various eslint errors. r=standard8
MozReview-Commit-ID: 2XbldhBnofs

--HG--
extra : rebase_source : f0c91dfbe37159077b8d0506913dd719fe577f17
2016-10-21 10:03:51 -07:00
Andy McKay
e4fa3c53f8 bug 1240631 so that both invalid windows and tabs hit runtime.lastError r=kmag
MozReview-Commit-ID: EflXdTBWEEO

--HG--
extra : rebase_source : f3464383ec97250a3778ba627df10c210b3c5242
2016-10-21 14:45:18 -07:00
Kris Maglione
16e60b24ea Bug 1312224: Fix race in browser_ext_browserAction_popup_resize.js. r=me
MozReview-Commit-ID: 6pSsJDfNJzO

--HG--
extra : rebase_source : 822a6e27c79fee454404b568dd7d9edffd4d8c96
2016-10-22 14:22:43 -07:00
Kris Maglione
8e0d5c9c7e Bug 1287209: Make popup tests compatible with remote browsers. r=aswan
MozReview-Commit-ID: 79Xa3j5Kzov

--HG--
extra : source : 642ee7eb70bbe1d512a06cf6478910bd2d0db273
extra : intermediate-source : 50dcca551b63ee6e9b07207208d6cb1c239467af
extra : histedit_source : ac9867b9d5c0a1666f751b86199b4ba14e32d918%2C6261a9a05cd6386e2abfeddddf6f67a1d208d6f3
2016-10-20 19:02:14 -07:00
Kris Maglione
062bc47b74 Bug 1287209: Handle popup and options browser resizing using a frame script. r=aswan
MozReview-Commit-ID: DIfynklqrus

--HG--
extra : source : 68806639c03110bfb67dd6c705a5441a917afcd6
extra : intermediate-source : cc7503f09572bc49cd2f86184d0d3abc810351c3
2016-10-20 15:27:51 -07:00
Tomislav Jovanovic
3743f656f6 bug 1290057 - fire onFocusChanged when Firefox loses/gains focus r=kmag
MozReview-Commit-ID: 7OdyglGjnFQ

--HG--
extra : rebase_source : 72fc9d46f004366419b0dd62c6e2ab201ab9fef1
2016-10-14 05:38:34 +02:00
Sebastian Hengst
0c23c32b56 Backed out changeset 68806639c031 (bug 1287209) for failing browser-chrome test browser_ext_popup_corners.js. r=backout 2016-10-20 09:17:03 +02:00
Sebastian Hengst
304f2d4ce5 Backed out changeset 642ee7eb70bb (bug 1287209) 2016-10-20 09:16:15 +02:00
Kris Maglione
0d4f94f79a Bug 1287209: Make popup tests compatible with remote browsers. r=aswan
MozReview-Commit-ID: 79Xa3j5Kzov

--HG--
extra : rebase_source : 4746880f12993aab2055221d752be50105278a85
2016-10-19 15:13:25 -07:00
Kris Maglione
00de90e4be Bug 1287209: Handle popup and options browser resizing using a frame script. r=aswan
MozReview-Commit-ID: DIfynklqrus

--HG--
extra : rebase_source : fe673f907b56f4d2bdc53be2e37271541c5332d6
2016-10-19 20:19:43 -07:00
Kris Maglione
919d2fdacb Bug 1294442: Follow-up: Fix additional windows-only test failures. r=bustage
MozReview-Commit-ID: 2fz7eeC7WLm

--HG--
extra : rebase_source : 0885b5701013ed9e287f5d19e15ccbdcb1b02439
2016-10-19 18:52:15 -07:00