Commit Graph

798 Commits

Author SHA1 Message Date
Mike de Boer
6265f537f9 Bug 1330349 - Part 1 - move the new theme WebExtension API to the toolkit collection of APIs. r=aswan
MozReview-Commit-ID: D2SwtSu1VZw
2017-03-01 17:57:13 +01:00
Kris Maglione
4c12719b3a Bug 1258360: Implement onMessageExternal and onConnectExternal. r=mixedpuppy
MozReview-Commit-ID: 7NTrgyWpXbv
2017-02-11 13:28:18 -08:00
Wes Kocher
a15a62c213 Merge m-c to inbound, a=merge
MozReview-Commit-ID: Fypud50dqYw
2017-03-02 15:03:11 -08:00
Kris Maglione
65a62be325 Bug 1336757: Follow-up: Disable fromCache checks, for now.
MozReview-Commit-ID: wqePVZUMKD
2017-03-02 12:28:17 -08:00
Kris Maglione
835dfa20ac Bug 1336757: Re-enable webnavigation and webrequest tests on infra. r=me 2017-03-01 16:27:43 -08:00
Andrea Marchesini
bd6c542215 Bug 1335539 - Get rid of nsIDOMWindowUtils.wrapDOMFile, r=smaug, r=Gijs 2017-03-02 17:15:29 +01:00
Sebastian Hengst
fac70eb6bc Backed out changeset 5c2a88e35ffc (bug 1330349) for failing xpcshell test test_dss.js. r=backout 2017-03-01 20:09:01 +01:00
Mike de Boer
f8071d3fbe Bug 1330349 - Part 1 - move the new theme WebExtension API to the toolkit collection of APIs. r=aswan
MozReview-Commit-ID: D2SwtSu1VZw
2017-03-01 17:57:13 +01:00
Kris Maglione
be885c3aa9 Bug 1314361 - Part 2: Stop using addonId origin attribute for permission checks. r=billm 2016-11-04 15:16:50 -07:00
Sebastian Hengst
84989518a1 Bug 1310427 - support protocol handlers: disable test on Android (bug 1342577). r=test-disabling-to-fix-orange-as-requested-by-developer 2017-02-25 00:19:46 +01:00
Shane Caraveo
3f052b895e Bug 1310427 support protocol handlers, r=kmag
MozReview-Commit-ID: 7sHh8YZWe3f
2017-02-24 11:20:20 -08:00
Masatoshi Kimura
5cb2f74bc6 Bug 1342144 - Revert version parameters in test_ext_jsversion.html. r=kmag
This file ensures that versioned JavaScript does NOT work in WebExtensions. So the version parameter is actually required.

MozReview-Commit-ID: Ge5lndjxGdK
2017-02-24 20:53:05 +09:00
Masatoshi Kimura
4f2e64ad3d Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;

MozReview-Commit-ID: AzhtdwJwVNg
2017-02-23 06:10:07 +09:00
Tomislav Jovanovic
1e11d64036 Bug 1340556 - Add tests for clipboardRead from the background page r=mixedpuppy
MozReview-Commit-ID: 1eQ1JUBt5ps
2017-02-22 00:30:41 +01:00
Ethan Glasser-Camp
d73b81655b Bug 1328974: Record metrics for chrome.storage.sync usage, r=bsmedberg,kmag
MozReview-Commit-ID: 7c2CHLuXxS6
2017-01-17 13:25:02 -05:00
Bob Silverberg
a8478b79ad Bug 1312802 - Implement chrome.privacy API, r=aswan
MozReview-Commit-ID: 5DoGnYb945Z
2017-02-15 17:32:24 -05:00
Carsten "Tomcat" Book
9fbc541997 merge mozilla-inbound to mozilla-central a=merge 2017-02-20 14:05:25 +01:00
Xidorn Quan
57b3c7d52d Bug 1339394 - Don't serialize transparent color to transparent keyword when not necessary. r=heycam,jaws
MozReview-Commit-ID: 59cmaCoFJMR
2017-02-16 10:26:13 +11:00
Bob Silverberg
3a5d69e781 Bug 1320736 - Part 3: Create ExtensionPreferencesManager module, r=aswan
MozReview-Commit-ID: BiY8XikUSUV
2017-01-16 17:30:47 -05:00
Bob Silverberg
d997693083 Bug 1320736 - Part 2: Create ExtensionSettingsStore module, r=aswan
MozReview-Commit-ID: A6zWB58OAlB
2017-01-12 17:12:05 -05:00
Tomislav Jovanovic
410a8bbf73 Bug 1311815 - Check host permissions for webRequest listeners r=kmag
MozReview-Commit-ID: 9bcb4p7tP2u
2017-02-16 14:56:35 +01:00
Ethan Glasser-Camp
c1eac866a9 Bug 1321570: Remove duplicate tests, r=kmag
These tests are essentially the same as the tests of the same name in
test_ext_storage.js. These tests could maybe be valuable if they were
content script tests instead of background script tests, but they
aren't, so let's delete them.

MozReview-Commit-ID: I7rIR7ecoEZ
2017-01-24 14:54:11 -05:00
Ethan Glasser-Camp
47631b96d6 Bug 1321570 - Rewrite KintoServer in tests, r=kmag
Allow individual records to decide whether or not they want to appear
in a certain request, and be more explicit with our handling of time,
since the client is already tracking this using etag and providing it
to us using _since. This allows us to get rid of hacks like
`encryptAndAddRecordOnlyOnce` and `addRecordInPast`. While we're here,
change the method signatures for `addRecord` to make them more
flexible. Also, make the server agnostic about "collections" and instead
focus only on records.

Conflicts are still something we have to handle explicitly because in
order to trigger conflict behavior in the client, they have to appear
between two client requests (i.e. within a sync() call). So we don't
show them on GET requests but surface them on POST requests.

MozReview-Commit-ID: B7aaMTzu268
2017-01-11 13:35:22 -05:00
Ethan Glasser-Camp
8e51fef619 Bug 1321570 - use dependency injection for fxAccounts, r=kmag
Get rid of the ugly hack where test code monkeypatches a singleton to
convince the rest of the ExtensionStorageSync code that a fake user is
logged in. Instead, take a handle to the fxAccounts service at
construction time. Test code can provide any kind of fxAccounts it
wants, including one that has a hard-coded user.

This provokes a bunch of changes:

- ExtensionStorageSync is now no longer a singleton, but a class. You
  have to instantiate it in order to do anything with it. A global
  instance extensionStorageSync is provided for use by Sync code as
  well as WebExtension code.

- CryptoCollection is now also a class, and each ExtensionStorageSync
  instance has its own CryptoCollection. This dependency should maybe
  also be injected, but for the time being it doesn't provide us any
  value to do so.

- Converting singletons with asynchronous methods to classes is a pain
  in the neck. We convert async method foo from `foo:
  Task.async(....)` to `async foo() { .... }`. While we're here,
  convert KeyRingEncryptionRemoteTransformer#decode to async/await to
  eliminate a need for `let self = this`.

- Update Sync code and WebExtension code to use extensionStorageSync.

- There's a cyclic dependency where CryptoCollection#sync depends on
  ExtensionStorageSync#_syncCollection which depends on
  CryptoCollection#getKeyRing. As a short-term hack, we now require an
  ExtensionStorageSync argument to CryptoCollection#sync.

- KeyRingEncryptionRemoteTransformer now takes a handle to fxAccounts
  on construction time as well. Because this is the only
  EncryptionRemoteTransformer subclass that accesses fxAccounts, we
  can get rid of the hack where the tests monkeypatch something in the
  EncryptionRemoteTransformer prototype.

- CollectionKeyEncryptionRemoteTransformer now takes a handle to a
  CryptoCollection, rather than relying on a global one.

- A bunch of methods that previously assumed access to fxAccounts now
  check if fxAccounts is present (i.e. if we're on Android). Strictly
  speaking, this isn't required by this change, but it helps make
  certain kinds of failure a little easier to diagnose.

- Update tests, including extracting a domain-specific helper method
  to hide the use of CollectionKeyEncryptionRemoteTransformer. We now
  no longer monkeypatch in our mock fxaService, but pass it to the
  test so that it can do whatever it wants with it. We also provide an
  ExtensionStorageSync instance for convenience. Access to the global
  cryptoCollection is now done through an ExtensionStorageSync
  instance.

To summarize, we've gone from a situation where a bunch of singletons
had implicit dependencies on other singletons in a shared global
namespace, to a situation where dependencies are provided explicitly
using method/constructor arguments. This highlights some of the
dependencies present:

- ExtensionStorageSync depends on CryptoCollection and fxAccounts if
  it needs to sync

- Every collection created via openCollection needs a handle to
  CryptoCollection so it can correctly create its remote transformers

- CryptoCollection needs a handle to fxAccounts so it can create its
  own remote transformer for its special collection

Most of this is only possible, or at least much easier, because we no
longer try to juggle Sqlite connections but just keep one around
forever.

However, please note:

- CryptoCollection needs a handle to ExtensionStorageSync to actually
  perform syncing logic because that's where we foolishly put the
  logic to make requests

- There's still a backing Sqlite store which is shared by everything

- There's still a singleton tracking contexts that opened extensions
  which we manage to try to clean contexts up correctly

MozReview-Commit-ID: DGIzyRTdYZ1
2017-01-10 16:44:01 -05:00
Ethan Glasser-Camp
447d4b287d Bug 1321570 - Move ExtensionStorageSync crypto out of services/sync, r=kmag
Since services/sync doesn't ship on Android, this meant
conditionally-defining some variables such as `cryptoCollection` and
`CollectionKeyEncryptionRemoteTransformer` depending on whether or not
we were on Android. However, none of these definitions really rely on
functionality that isn't present on Android (although you can't really
use them yet either). Move the dependency together with the dependant
code so we can simplify a bit. This lets us remove conditional uses of
`cryptoCollection` and `CollectionKeyEncryptionRemoteTransformer`.

Because the WebExtensions source directory has more stringent eslint
rules, we end up reformatting and commenting a bit in addition to
moving.

MozReview-Commit-ID: 2ddDeymYFNi
2017-02-13 15:06:02 -05:00
Tomislav Jovanovic
26f5d62ada Bug 1312260 - Part 2: Test access to "paste" command with clipboardRead permission r=aswan
MozReview-Commit-ID: GTdI8cJArXs
2017-02-10 20:57:25 +01:00
Phil Ringnalda
b47dfd81da Merge m-c to m-i 2017-02-11 18:19:11 -08:00
Phil Ringnalda
59eb92c627 Merge m-i to m-c, a=merge 2017-02-11 17:42:19 -08:00
Phil Ringnalda
8b8e8c7091 Backed out changeset 3ac2e09d98cb (bug 1308688) for eslint failures
CLOSED TREE
2017-02-10 21:21:36 -08:00
Kris Maglione
18320a2864 Bug 1338409: Part 2 - Lazily parse the schema data for each namespace property, as it is needed. r=aswan
MozReview-Commit-ID: FNQJdt6BnjI
2017-02-09 18:59:49 -08:00
Kris Maglione
8ab50cf4da Bug 1338409: Part 1 - Lazily parse the schema data for each namespace as it is needed. r=aswan
MozReview-Commit-ID: 73q9ba9sLtb
2017-02-10 21:06:55 -08:00
Ethan Glasser-Camp
3e4199a169 Bug 1333810: Hash record IDs during encryption, r=kmag,rnewman
This does a sha256 of record IDs, the same way we do for collection
IDs, during encryption.

The way we compute the new ID (using an overridden method) is a little
bit of a hack, but we use the new ID as part of the HMAC. This also
invalidates a previous assumption, which is that we kept record IDs
the same during decryption.

MozReview-Commit-ID: Gbzlo9OE1he
2017-01-31 13:09:38 -05:00
Ethan Glasser-Camp
622720b262 Bug 1333810: Redo hashing of collection ID, r=kmag,rnewman
This ties the collection ID used for a given extension to the "salts"
record. This blocks an attack where, given the user's ID, an attacker
could just hash all the extension IDs on addons.mozilla.org to
generate possible hashed collection IDs.

MozReview-Commit-ID: OABsOOMn2F
2017-01-30 19:07:02 -05:00
Ethan Glasser-Camp
cd9bfb54e8 Bug 1333810: Add salts to the keys record, r=kmag,rnewman
Because these need to be encrypted with kB like the keyring does, and
wiped at the same time as the keyring does, just smush them into the
keyring. Rename `ensureKeysFor` to `ensureCanSync`, but don't update
it to return the salts -- for now, we don't need that.

MozReview-Commit-ID: DOJxdx5ugKl
2017-01-30 16:03:59 -05:00
Ethan Glasser-Camp
a344b6ea54 Bug 1333810: Encrypt record deletes, r=kmag,rnewman
Camouflage deletes as updates, according to the rules given by the new
RemoteTransformer contract.

MozReview-Commit-ID: CwVJSs2jOil
2017-01-27 19:27:10 -05:00
Shane Caraveo
2167bf8191 Bug 1308640 bypass TP when addon has explicit permission to url, r=bz,kmag,mrbkap
MozReview-Commit-ID: BIhoUY2Ug8k
2017-02-09 21:08:06 -08:00
Andrew Swan
7ecb5f6860 Bug 1308688 tests r=kmag
MozReview-Commit-ID: 8DOZbPY7FZ9
2016-10-26 16:22:56 -07:00
Andrew Swan
b98857e2e8 Bug 1308688 tests r=kmag
MozReview-Commit-ID: 8DOZbPY7FZ9
2016-10-26 16:22:56 -07:00
Shane Caraveo
f737079118 Bug 1203233 implement geolocation permission, r=aswan,florian
MozReview-Commit-ID: 8V7bNyeGZNh
2017-02-04 16:10:50 -08:00
Jonathan Kew
3aca604bfc Bug 1312049 - Switch nsChromeRegistry::GetDirectionForLocale to use uloc_isRightToLeft instead of a list of known-rtl locales, and replace the now-obsolete intl.uidirection.* prefs with a single override intl.uidirection for testing purposes. r=gandalf 2017-02-02 22:12:50 +00:00
Carsten "Tomcat" Book
2ecd3be932 merge mozilla-inbound to mozilla-central a=merge 2017-02-02 14:25:20 +01:00
Tomislav Jovanovic
e35190e2e5 Bug 1310318 - Part 2: Test access to canvas drawWindow() with permission r=kmag
MozReview-Commit-ID: 4ee3pRfduIj
2017-01-26 22:34:48 +01:00
Kris Maglione
c6e760d95d Bug 1260548: Part 9 - Make sure Android mochitests do not leave extra tabs open. r=aswan
MozReview-Commit-ID: 7N3KuVX8kRC
2017-02-01 13:46:09 -08:00
Kris Maglione
b75166a3bc Bug 1260548: Part 6 - Add basic tabs API support for Android. r=aswan
MozReview-Commit-ID: JJgcKp4AZ9S
2017-02-01 15:21:00 -08:00
Luca Greco
506191cda5 Bug 1332995 - Add transition properties on onReferenceFragmentUpdated events r=aswan
MozReview-Commit-ID: APk10REzKfG
2017-01-27 05:26:17 +01:00
Wes Kocher
5c5bcbe39e Merge inbound to central, a=merge
MozReview-Commit-ID: HvoljuLV6Gj
2017-01-27 16:37:18 -08:00
Gijs Kruitbosch
50b99231ab Bug 1333164 - fix invalid references to mochitest stylesheet, r=erahm
MozReview-Commit-ID: 1Xxt72jYdm7
2017-01-24 14:24:04 +00:00
Shane Caraveo
f094e18e5f Bug 1190689 implement onAuthRequired for WebRequest, r=kmag
MozReview-Commit-ID: D6ydPIMNzDI
2017-01-26 13:40:36 -08:00
Andrew Swan
e034c4e908 Bug 1203330 Part 3 Remove EventManager r=kmag
Also clean up some test warnings related to event listener IPC
along the way.

MozReview-Commit-ID: KOBQX3TynV
2017-01-26 11:27:31 -08:00
Andrew Swan
1ac8741081 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X
2017-01-26 20:00:33 -08:00