Make `mach test-unit` not recompile components after `mach build`
Previously, the `tests` feature flag of the `embedder_traits` crate caused it and every crate recursively depending on it to be built twice.
This feature flag was used to provide a specific set of "resources" when running tests. Instead, this commits overrides the `main()` function of the test harness to change resources at runtime before running any test.
This is done by adding a dependency that has `name = "test"` in its `[lib]` section of `Cargo.toml`. This overrides the crate found by `extern crate test;` in code generated by `rustc --test`.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21884)
<!-- Reviewable:end -->
Previously, the `tests` feature flag of the `embedder_traits` crate
caused it and every crate recursively depending on it to be built twice.
This feature flag was used to provide a specific set of "resources"
when running tests. Instead, this commits overrides the `main()` function
of the test harness to change resources at runtime before running any test.
This is done by adding a dependency that has `name = "test"` in its
`[lib]` section of `Cargo.toml`. This overrides the crate found by
`extern crate test;` in code generated by `rustc --test`.
Make JNI code more robust and introduce antialiasing option
This throws exceptions in various places. Trying to reduce the amount of unwrap/expect.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#21306 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21871)
<!-- Reviewable:end -->
The tarball for 0.4.1 is 44 KB uncompressed and contains 18 files.
The tarball for 0.4.0 is 45 MB uncompressed and contains 22113 files,
most of which appear to be the output of `cargo doc` that was accidentally
included in a release.
Fix flickering on Android
This is particularly noticeable in debug builds on WebGL pages, but also appears during startup when loading normal pages. requestRender() causes Android to swap buffers under the assumption that the buffer contains a fully rendered frame, but when calling it from `doFrame` there are no guarantees that Servo has finished compositing yet. This causes stale buffers to be composited instead, leading to flickering at startup when there is no content, or general jerkiness on pages using animation callbacks as previous frames replace current frames.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#21796
- [x] These changes do not require tests because no android integration tests.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21842)
<!-- Reviewable:end -->
Create a Maven repository on package
This new step will go through all the *release* builds of the servoview AAR, and create a maven repo (just a tree of directories) with the relevant POM files under `target/gradle/servoview/maven`.
For example, after building for armv7 and x86, it looks like this:
```
/Users/paul/git/servo/target/gradle/servoview/maven
└── org
└── mozilla
└── servoview
├── servoview-armv7
│ ├── 0.0.1.20181002
│ │ ├── servoview-armv7-0.0.1.20181002.aar
│ │ ├── servoview-armv7-0.0.1.20181002.aar.md5
│ │ ├── servoview-armv7-0.0.1.20181002.aar.sha1
│ │ ├── servoview-armv7-0.0.1.20181002.pom
│ │ ├── servoview-armv7-0.0.1.20181002.pom.md5
│ │ └── servoview-armv7-0.0.1.20181002.pom.sha1
│ ├── maven-metadata.xml
│ ├── maven-metadata.xml.md5
│ └── maven-metadata.xml.sha1
└── servoview-x86
├── 0.0.1.20181002
│ ├── servoview-x86-0.0.1.20181002.aar
│ ├── servoview-x86-0.0.1.20181002.aar.md5
│ ├── servoview-x86-0.0.1.20181002.aar.sha1
│ ├── servoview-x86-0.0.1.20181002.pom
│ ├── servoview-x86-0.0.1.20181002.pom.md5
│ └── servoview-x86-0.0.1.20181002.pom.sha1
├── maven-metadata.xml
├── maven-metadata.xml.md5
└── maven-metadata.xml.sha1
```
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21851)
<!-- Reviewable:end -->
Enable fake fillText API in nightly builds.
The [three.js examples](https://threejs.org/examples/) are really useful for checking Servo WebGL support, but if the fillText API is not available they only display a blank screen. I think it's worth lying to web content about this API in order to make it easy to make use of these examples without using local development builds.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21826)
<!-- Reviewable:end -->
Optional backtraces for JS errors and WebGL errors
This adds two new build-time features to enable useful debugging tools when investigating why JS and WebGL content isn't working. They're optional because they're quite heavyweight.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they're optional developer features.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21825)
<!-- Reviewable:end -->
Warn when using slow WebGL code path.
This will make it more obvious when one source of WebGL performance problems is present.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21828)
<!-- Reviewable:end -->