This reads from "assets/distribution/**" in the APK and writes to
"distribution/**" in the data directory. That output is the same, but
the input used to read from "distribution/**", which is not really
supported by modern build tooling (Gradle), which doesn't allow to
write files directly into the APK root.
I manually tested this without issue. I see no way to add meaningful
tests to our current Robocop test suite; the long term testing
approach is to develop a new test for this functionality and only run
it against the "distribution" build type that was added in Bug
1163080. However, that's a larger project than I have time for now.
This simply packs the assets/ subdirectory of the distribution
directory into the assets/ directory of the Android APK using existing
mechanisms. It also removes the older method of manually pushing
files into dist/bin/distribution, from where they would be packaged
into the APK under distribution/.
A few notes: the test is live, so I've marked it @Ignore, so that it
doesn't run during |mach gradle test|. There's some value in mocking
the service endpoint, but this is how I verify that the server works,
so it has more value right now as a live test than a mocked test. In
the future, that probably won't be true.
There are issues running the test locally because Robolectric doesn't
provide all the cipher suites we use in GlobalConstants: in
particular, the GCM suites aren't supported. This may improve as
Robolectric matures, or we may add a work-around in the code (like at
http://androidxref.com/4.4.4_r1/xref/libcore/support/src/test/java/libcore/java/security/StandardNames.java#68),
or we may add a test-specific flag. For now, I'm not going to address
it directly.
Finally, I put the code in mobile/android/services, simply because the
less that goes into base, the better our build times will be.
This seems more consistent with what Android UI callbacks do. This commit also
means all callees must be adapted to use the background thread if needed.
Remove obsolete SIZE_CHANGED event and its handler in nsWindow. Also
remove some other supporting code (such as gAndroidBounds and the
FORCED_RESIZE event) that should be unnecessary by now.
Convert the SIZE_CHANGED event to a native method in GLController, and
carry over the SIZE_CHANGED implementation to the new implementation in
GLController. Some other changes were made for correctness in handling
size changes.
Right now, we rely on browser.js sending Gecko:Ready, to set the
GeckoThread state to RUNNING upon receiving Gecko:Ready. This patch
gets rid of this dependency on browser.js and Gecko:Ready.
Convert the old prefs code in browser.js to use observer notifications
that are sent by the new PrefsHelper implementation, in order to handle
pseudo-prefs.
Introduce a new implementation for PrefsHelper that does not use events
or rely on browser.js for getting and/or setting prefs. Also add an
addObserver method to better match the removeObserver method.