121 Commits

Author SHA1 Message Date
Dan Field
812955c39d Improve path metrics tests and docs (flutter/engine#7851)
* Improve path metrics tests and docs
2019-04-05 13:58:46 -07:00
Chinmay Garde
736277e9c7 Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (flutter/engine#8414)
This reverts commit 8a0076fdddc96b4ec2fb67f45051aa490827fc02.
2019-04-03 13:38:12 -07:00
Zachary Anderson
8a0076fddd Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (flutter/engine#8406)
This reverts commit 38f5fc418a08ed43945ad21d19494d6b352e1443.
2019-04-02 09:12:56 -07:00
MH Johnson
dc2da3460f [ui] Add null check in FontWeight.lerp (flutter/engine#8274)
* Add null check in FontWeight.lerp

* Add Unit tests for FontWeight.lerp
2019-04-01 21:56:19 -04:00
Chinmay Garde
38f5fc418a Separate the data required to bootstrap the VM into its own class. (flutter/engine#8397)
When attempting to shutdown and subsequently restart the VM, having the
VM own this data introduces lifecycle issues due to circular references.
2019-04-01 14:58:05 -07:00
Chinmay Garde
2d22e77e37 Add missing import to functional for Windows. (flutter/engine#8382) 2019-03-29 18:14:06 -07:00
Chinmay Garde
18af29469e Allow native entrypoint registration for runtime unittests. (flutter/engine#8379) 2019-03-29 17:53:49 -07:00
Chinmay Garde
39fb01b459 Allow running runtime_unittests in AOT mode. (flutter/engine#8375)
Previously, only the most basic tests were run in AOT mode.
2019-03-29 17:15:38 -07:00
Chinmay Garde
1a7c5d7bf3 GN Format all files in the engine. (flutter/engine#8369) 2019-03-29 12:44:57 -07:00
Chris Bracken
6bde234915 Cleanups to run_tests.sh script (flutter/engine#8337)
Bugfix:
* Use the `pub` from within the built Dart SDK (not whatever's on
  `$PATH`, if anything).

A few minor improvements:
* Allow running from below the src/ buildroot dir, as it's often
  convenient to work from within the flutter/engine git dir.
* Echo test name before running, for slightly better debuggability.
* Minor line-wrapping for readability.
2019-03-27 18:09:08 -07:00
Jonah Williams
b49939de1b Correct greater than or equal logic in offset base (flutter/engine#8210) 2019-03-19 13:41:47 -07:00
Dan Field
011838e2c8 Allow exported __const on iOS (flutter/engine#8217) 2019-03-19 11:56:55 -07:00
liyuqian
7ed28478d9 Reland PerformanceOverlayLayer golden test (flutter/engine#8140)
This reverts commit c416fe99ee0ddb464ca85c0b336d679ea626a03c.

Now we shouldn't break the engine build as https://chromium-review.googlesource.com/c/chromium/tools/build/+/1480746 is landed. The golden test is disabled by default and we'll enable it later in our recipe and test it in presubmit tests.
2019-03-12 14:10:11 -07:00
Chris Bracken
c416fe99ee Revert "Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (#7911)" (flutter/engine#7916)
This breaks the Linux build with:
```
[ RUN      ] PerformanceOverlayLayer.Gold
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
Golden file not found: "/b/s/w/ir/k/src/flutter/testing/resources"/performance_overlay_gold.png.
Please either set --golden-dir, or make sure that the unit test is run from the right directory (e.g., flutter/engine/src).
```

This reverts commit 3534a2c4cdfa35f921e99466013c7c8b3f03a8c3.
2019-02-21 17:04:34 -08:00
liyuqian
3534a2c4cd Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (flutter/engine#7911)
This reverts commit def147d48ee538dd7bbf0d2f0323a5d90a3d872c.
2019-02-21 15:27:37 -08:00
Chris Bracken
def147d48e Revert "Reland PerformanceOverlayLayer golden test (#7863)" (flutter/engine#7895)
Reverting this broke the flow tests for the performance overlay:

```
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
```

This reverts commit ad96de250ecc47a7c26134ad434150199539b00b.
2019-02-20 20:45:39 -08:00
Dan Field
53102bd3a2 Test profile and release build and unit tests (flutter/engine#7880)
* Test profile build and unit tests

* update googletest, skip JIT tests on non-debug builds
2019-02-20 20:13:02 -08:00
liyuqian
ad96de250e Reland PerformanceOverlayLayer golden test (flutter/engine#7863)
* Revert "Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (#7765)"

This reverts commit 284016b1e1d6e8badec99cbff907ddb900cd27c4.

* Add command line args for golden dir and font file
2019-02-20 16:49:39 -08:00
Dan Field
4206f443f7 Revert "Shut down and restart the Dart VM as needed. (#7832)" (flutter/engine#7877)
This reverts commit 75a66f31dc2a02ccb54f10fb4477233086f4906b.
2019-02-19 16:14:18 -08:00
Chinmay Garde
75a66f31dc Shut down and restart the Dart VM as needed. (flutter/engine#7832)
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.

This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.

Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
2019-02-15 14:16:17 -08:00
Jason Simmons
a0f4916009 Remove the Dart JIT snapshot data from AOT builds of the embedder library (flutter/engine#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
Dan Field
76529a8ee7 Allow specifying the buildtools path (flutter/engine#7815) 2019-02-13 15:16:49 -08:00
Dan Field
49d5433fcd Use newer Skia API for PathMeasure (flutter/engine#7809) 2019-02-13 11:15:19 -08:00
Dan Field
284016b1e1 Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (flutter/engine#7765)
This reverts commit a3b89e97a89a1c3bd725cf391ff7b6b0fe7e810b.
2019-02-09 00:13:14 -08:00
liyuqian
a3b89e97a8 Add mock capability to PerformanceOverlayLayer (flutter/engine#7537)
So we can do golden test on PerformanceOverlay to avoid regression like
https://github.com/flutter/flutter/issues/26387
2019-02-08 14:47:22 -08:00
Dan Field
82b3db0523 Fix versions implementation (flutter/engine#7726) 2019-02-07 08:53:31 -08:00
Matt Carroll
e1aeaf5dd4 Implemented Dark Mode for Android (#25525) (flutter/engine#7488) 2019-02-04 19:30:15 -08:00
Kaushik Iska
ec6f6c35b3 Expose the Flutter engine, Dart and Skia versions to Dart. (flutter/engine#7634)
- Moved versions from shell to common
- versions singleton contains all the required versions.
2019-01-30 16:22:45 -08:00
Jason Simmons
5c988ece29 Update the verify_exported script to include the symbols for ICU data (flutter/engine#7647) 2019-01-30 13:56:44 -08:00
Dan Field
b934c0495e Improve PathMetrics (flutter/engine#7621)
* Improve PathMetrics

* Use index instead of dirty

* revert unintended change

* space
2019-01-29 12:40:48 -08:00
Brian Osman
3dd1198f0d Remove SkColorSpaceXformCanvas, use color-managed SkSurfaces instead (flutter/engine#7548)
Behavior (visual) changes should be very minor. Things that are to be expected:
* A few things were not color managed correctly by the transform canvas (color emoji, some color filters). Those will be handled correctly with the tagged surfaces (although we're always transforming to sRGB, so nothing should change until we target a wider gamut).
* Image filtering will happen in the source color space, rather than the destination. Very minor.
* The transform canvas did caching of images in the destination color space. Now, the conversion happens at draw time. If there are performance issues, images can be pre-converted to the destination with makeColorSpace().
2019-01-22 15:34:51 -05:00
Chris Bracken
01da26e047 Support custom kernel blob path in test fixtures (flutter/engine#7525)
Updates the test_fixtures rule to support a custom kernel output file
name. Improves rule documentation.
2019-01-22 11:35:34 -08:00
Dan Field
a9728ab07a Make IOManager own resource context (flutter/engine#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Dan Field
2eae3feaaf fix up analysis for Dart in Engine (flutter/engine#7404)
* fix up analysis for Dart in Engine, particularly for tests
2019-01-11 13:50:58 -08:00
Dan Field
df35434ca0 Reset ParagraphBuilder after build() (flutter/engine#7401)
* Reset ParagraphBuilder after build()
2019-01-07 16:10:53 -08:00
Ben Konyi
15a34767e9 Update GetCallbackHandle to use Dart_IsTearOff instead of a string comparison (flutter/engine#7324)
* Update GetCallbackHandle to use Dart_IsTearOff instead of a string
comparison to determine whether or not a closure was provided as an
argument to PluginUtilities.GetCallbackHandle.

Fixes #24394
2019-01-04 14:41:56 -08:00
Chris Bracken
8a0cc94b1a Compile embedder unit test Dart to kernel (flutter/engine#7231)
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.

This relands commit 4e4fb4608da95d198b0e796478462285ab974a3c, which was
reverted in commit 566db0ecb8f293bb9f7ff1fc39076b08336e0148. Rather than
running as prebuilt_dart_action, we use dart_action to ensure the
frontend snapshot it compatible with the VM on which it's executed.
2018-12-16 12:23:18 -08:00
Chris Bracken
566db0ecb8 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
2018-12-15 14:43:26 -08:00
Chris Bracken
4e4fb4608d Compile embedder unit test Dart to kernel (flutter/engine#7227)
Compile embedder unit test Dart to kernel

As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.
2018-12-15 13:59:58 -08:00
Ian Hickson
ce62ca408f Offset.fromDirection and Size.aspectRatio (flutter/engine#6805) 2018-12-15 08:31:59 -08:00
Dan Field
681e4c6427 Flush UserSettings to window (flutter/engine#6850) 2018-11-13 23:41:56 -08:00
Dan Field
c0ce728956 disable embedder_unittests (flutter/engine#6798) 2018-11-08 11:18:21 -08:00
Michael Goderbauer
0def82ddb0 Unify copyright lines (flutter/engine#6757) 2018-11-07 12:24:35 -08:00
Gary Qian
48019d35ab Roll back _countryCode assert - breaking change (flutter/engine#6693)
* Roll back _countryCode assert - breaking change

* Add tests back in
2018-10-29 17:27:12 -07:00
hugovdm
20bd079a61 Add Locale.fromSubtags and support for scriptCode. (flutter/engine#6518)
* Add Locale.fromComponents.

* Change toString from underscores to dashes. Expand the unit tests.

* Rename 'fromComponents' to 'create'. Change variants from String to List<String>.

* Use default for language parameter. Use hashCode/hashList.

* Have toString() stick with old (underscore) behaviour.

* Demonstrate empty-list bug in assert code.

* Fix empty-list assert bug.

* Add ignores for lint issues. Unsure about 71340 though.

* Fix operator== via _listEquals.

* Remove length-checking asserts: we're anyway not checking characters in fields.

* Documentation update.

* Change reasoning for ignore:prefer_initializing_formals.

* Try 'fromSubtags' as new constructor name.

* Documentation improvements based on Pull Request review.

* Assert-fail for invalid-length subtags and drop bad subtags in production code.

* Revert "Assert-fail for invalid-length subtags and drop bad subtags in production code."

This reverts commit d6f06f5e7b3537d60000c47641580475ef16abbe.

* Re-fix Locale.toString() for variants=[].

* Tear out variants, in case we want to have one fewer pointer in the future.

* Make named parameters' names consistent with member names.

* Also remove _listEquals: no longer in use.

* Lint fix.

* Fix code review nits.

* Lint fix for assert, and a couple more not-zero-length-string asserts.

* Code Review: two of three nits addressed...

* Review fix: change 'should' to 'must' for subtag prescriptions.

* Assert-check that countryCode is never ''.
2018-10-29 14:48:59 -07:00
Chinmay Garde
db31e09d15 Run all supported host unit tests on Cirrus. (flutter/engine#6575) 2018-10-17 17:44:11 -07:00
Gary Qian
b4a3ad2e28 Pass full locale list with script and variant codes to framework (flutter/engine#6557)
* Locale Passing

* Pass full locale list and script and variant codes to framework

* Working Android locale list passing and fallback
2018-10-17 10:53:01 -07:00
Gary Qian
45577f1f07 Pass scriptcode and variantcode to dart:ui Window. (flutter/engine#6493) 2018-10-10 17:22:59 -07:00
Michael Klimushyn
893f867f36 Add a ratio cap to decoded animated image frames (flutter/engine#6310)
Provide a relative, per-image limit to the amount of memory
that's used to cache decoded image frames. Adds an overridable default
that developers can set to control how much memory images are allowed
to use decoded vs undecoded. The cap is set in flutter/flutter#22452.

Note that required frames are always cached regardless of the ratio cap,
because they're currently necessary for the GIF to animate. Previously
cached unessential frames are not cleared in response to the cache
hitting or exceeding the cap.

Addresses #20998 and #14344.
2018-10-09 17:07:46 -07:00
Michael Klimushyn
27cd6283b7 Fix failing test on Cirrus (flutter/engine#6469)
Updates the tests to use the `--use-test-fonts` argument.

Fixes flutter/flutter#22682
2018-10-08 15:47:53 -07:00