From 54eac35138dc4b9ada220799491984c916ef5c30 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Tue, 12 Sep 2023 11:38:47 -0700 Subject: [PATCH 1/6] [iOS] move arm64 builds to arm machines (#45721) Some builds in ci can happen on arm machines, see https://github.com/flutter/engine/pull/45664/files#r1322197862 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- ci/builders/mac_ios_engine.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/builders/mac_ios_engine.json b/ci/builders/mac_ios_engine.json index 5e3e9065a18a9..20f687338cc72 100644 --- a/ci/builders/mac_ios_engine.json +++ b/ci/builders/mac_ios_engine.json @@ -26,7 +26,6 @@ { "drone_dimensions": [ "device_type=none", - "mac_model=Macmini8,1", "os=Mac-12" ], "gn": [ @@ -50,7 +49,6 @@ { "drone_dimensions": [ "device_type=none", - "mac_model=Macmini8,1", "os=Mac-12" ], "gn": [ @@ -74,7 +72,6 @@ { "drone_dimensions": [ "device_type=none", - "mac_model=Macmini8,1", "os=Mac-12" ], "gn": [ @@ -99,7 +96,6 @@ { "drone_dimensions": [ "device_type=none", - "mac_model=Macmini8,1", "os=Mac-12" ], "gn": [ From 2c53043401f5b5628df1590792a275bb64eeca1f Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Tue, 12 Sep 2023 11:43:40 -0700 Subject: [PATCH 2/6] [ios] Fix testDeallocated failing locally. (#45663) Moving the code block to autorelease pool to ensure the FlutterEngine is released in the test. Fixes: https://github.com/flutter/flutter/issues/134388 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm index 2971c23f906b6..9a64083b1d280 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm @@ -113,7 +113,7 @@ - (void)testInfoPlist { - (void)testDeallocated { __weak FlutterEngine* weakEngine = nil; - { + @autoreleasepool { FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar"]; weakEngine = engine; [engine run]; From 14a858ce9eaea679410fb117eac28dc8d17ad6ba Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Tue, 12 Sep 2023 12:03:08 -0700 Subject: [PATCH 3/6] Fix JS interop signatures to use only JS types. (#45668) This prepares for some upcoming changes to dart2js which will be more strict about what types can be used in a JS interop declaration. --- lib/web_ui/lib/src/engine/app_bootstrap.dart | 26 +++------- .../engine/canvaskit/image_web_codecs.dart | 2 +- .../lib/src/engine/js_interop/js_loader.dart | 49 +++++++++++-------- .../lib/src/engine/js_interop/js_promise.dart | 41 ++++++---------- .../lib/src/engine/safe_browser_api.dart | 22 ++------- .../test/canvaskit/canvaskit_api_test.dart | 22 ++++----- .../test/engine/app_bootstrap_test.dart | 14 ++++-- .../test/engine/browser_detect_test.dart | 26 +++++----- .../test/engine/initialization_test.dart | 11 +++-- lib/web_ui/test/engine/window_test.dart | 20 ++++---- 10 files changed, 107 insertions(+), 126 deletions(-) diff --git a/lib/web_ui/lib/src/engine/app_bootstrap.dart b/lib/web_ui/lib/src/engine/app_bootstrap.dart index f3d5a70cc3424..dc0bf098f4a05 100644 --- a/lib/web_ui/lib/src/engine/app_bootstrap.dart +++ b/lib/web_ui/lib/src/engine/app_bootstrap.dart @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:js/js_util.dart' show allowInterop; - import 'configuration.dart'; import 'js_interop/js_loader.dart'; -import 'js_interop/js_promise.dart'; /// The type of a function that initializes an engine (in Dart). typedef InitEngineFn = Future Function([JsFlutterConfiguration? params]); @@ -40,33 +37,26 @@ class AppBootstrap { // This is a convenience method that lets the programmer call "autoStart" // from JavaScript immediately after the main.dart.js has loaded. // Returns a promise that resolves to the Flutter app that was started. - autoStart: allowInterop(() => futureToPromise(() async { + autoStart: () async { await autoStart(); // Return the App that was just started return _prepareFlutterApp(); - }())), + }, // Calls [_initEngine], and returns a JS Promise that resolves to an // app runner object. - initializeEngine: allowInterop(([JsFlutterConfiguration? configuration]) => futureToPromise(() async { + initializeEngine: ([JsFlutterConfiguration? configuration]) async { await _initializeEngine(configuration); return _prepareAppRunner(); - }())) + } ); } /// Creates an appRunner that runs our encapsulated runApp function. FlutterAppRunner _prepareAppRunner() { - return FlutterAppRunner(runApp: allowInterop(([RunAppFnParameters? params]) { - // `params` coming from JS may be used to configure the run app method. - return Promise(allowInterop(( - PromiseResolver resolve, - PromiseRejecter _, - ) async { - await _runApp(); - // Return the App that was just started - resolve.resolve(_prepareFlutterApp()); - })); - })); + return FlutterAppRunner(runApp: ([RunAppFnParameters? params]) async { + await _runApp(); + return _prepareFlutterApp(); + }); } /// Represents the App that was just started, and its JS API. diff --git a/lib/web_ui/lib/src/engine/canvaskit/image_web_codecs.dart b/lib/web_ui/lib/src/engine/canvaskit/image_web_codecs.dart index 13563d0b52902..74a06d6cd4d6d 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/image_web_codecs.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/image_web_codecs.dart @@ -142,7 +142,7 @@ Future readVideoFramePixelsUnmodified(VideoFrame videoFrame) async { // In dart2wasm, Uint8List is not the same as a JS Uint8Array. So we // explicitly construct the JS object here. final JSUint8Array destination = createUint8ArrayFromLength(size); - final JsPromise copyPromise = videoFrame.copyTo(destination); + final JSPromise copyPromise = videoFrame.copyTo(destination); await promiseToFuture(copyPromise); // In dart2wasm, `toDart` incurs a copy here. On JS backends, this is a diff --git a/lib/web_ui/lib/src/engine/js_interop/js_loader.dart b/lib/web_ui/lib/src/engine/js_interop/js_loader.dart index 2e65f2aeb767c..096fb57915a15 100644 --- a/lib/web_ui/lib/src/engine/js_interop/js_loader.dart +++ b/lib/web_ui/lib/src/engine/js_interop/js_loader.dart @@ -8,9 +8,7 @@ library js_loader; import 'dart:js_interop'; import 'package:js/js_util.dart' as js_util; - -import '../configuration.dart'; -import 'js_promise.dart'; +import 'package:ui/src/engine.dart'; @JS() @staticInterop @@ -34,6 +32,17 @@ extension FlutterLoaderExtension on FlutterLoader { bool get isAutoStart => !js_util.hasProperty(this, 'didCreateEngineInitializer'); } +/// Typedef for the function that initializes the flutter engine. +/// /// +/// [JsFlutterConfiguration] comes from `../configuration.dart`. It is the same +/// object that can be used to configure flutter "inline", through the +/// (to be deprecated) `window.flutterConfiguration` object. +typedef InitializeEngineFn = Future Function([JsFlutterConfiguration?]); + +/// Typedef for the `autoStart` function that can be called straight from an engine initializer instance. +/// (Similar to [RunAppFn], but taking no specific "runApp" parameters). +typedef ImmediateRunAppFn = Future Function(); + // FlutterEngineInitializer /// An object that allows the user to initialize the Engine of a Flutter App. @@ -44,23 +53,19 @@ extension FlutterLoaderExtension on FlutterLoader { @anonymous @staticInterop abstract class FlutterEngineInitializer{ - external factory FlutterEngineInitializer({ + factory FlutterEngineInitializer({ required InitializeEngineFn initializeEngine, required ImmediateRunAppFn autoStart, + }) => FlutterEngineInitializer._( + initializeEngine: (([JsFlutterConfiguration? config]) => futureToPromise(initializeEngine(config))).toJS, + autoStart: (() => futureToPromise(autoStart())).toJS, + ); + external factory FlutterEngineInitializer._({ + required JSFunction initializeEngine, + required JSFunction autoStart, }); } -/// Typedef for the function that initializes the flutter engine. -/// -/// [JsFlutterConfiguration] comes from `../configuration.dart`. It is the same -/// object that can be used to configure flutter "inline", through the -/// (to be deprecated) `window.flutterConfiguration` object. -typedef InitializeEngineFn = Promise Function([JsFlutterConfiguration?]); - -/// Typedef for the `autoStart` function that can be called straight from an engine initializer instance. -/// (Similar to [RunAppFn], but taking no specific "runApp" parameters). -typedef ImmediateRunAppFn = Promise Function(); - // FlutterAppRunner /// A class that exposes a function that runs the Flutter app, @@ -68,10 +73,14 @@ typedef ImmediateRunAppFn = Promise Function(); @JS() @anonymous @staticInterop -abstract class FlutterAppRunner { +abstract class FlutterAppRunner extends JSObject { + factory FlutterAppRunner({required RunAppFn runApp,}) => FlutterAppRunner._( + runApp: (([RunAppFnParameters? args]) => futureToPromise(runApp(args))).toJS + ); + /// Runs a flutter app - external factory FlutterAppRunner({ - required RunAppFn runApp, // Returns an App + external factory FlutterAppRunner._({ + required JSFunction runApp, // Returns an App }); } @@ -84,7 +93,7 @@ abstract class RunAppFnParameters { } /// Typedef for the function that runs the flutter app main entrypoint. -typedef RunAppFn = Promise Function([RunAppFnParameters?]); +typedef RunAppFn = Future Function([RunAppFnParameters?]); // FlutterApp @@ -92,7 +101,7 @@ typedef RunAppFn = Promise Function([RunAppFnParameters?]); @JS() @anonymous @staticInterop -abstract class FlutterApp { +abstract class FlutterApp extends JSObject { /// Cleans a Flutter app external factory FlutterApp(); } diff --git a/lib/web_ui/lib/src/engine/js_interop/js_promise.dart b/lib/web_ui/lib/src/engine/js_interop/js_promise.dart index 5f7e61dd3217e..6ad06b21566b4 100644 --- a/lib/web_ui/lib/src/engine/js_interop/js_promise.dart +++ b/lib/web_ui/lib/src/engine/js_interop/js_promise.dart @@ -11,40 +11,27 @@ import 'package:js/js_util.dart' as js_util; import '../util.dart'; -@JS() -@staticInterop -class PromiseResolver {} - -extension PromiseResolverExtension on PromiseResolver { - void resolve(T result) => js_util.callMethod(this, 'call', [this, if (result != null) result]); -} - -@JS() -@staticInterop -class PromiseRejecter {} - -extension PromiseRejecterExtension on PromiseRejecter { - void reject(Object? error) => js_util.callMethod(this, 'call', [this, if (error != null) error]); +extension CallExtension on JSFunction { + external void call(JSAny? this_, JSAny? object); } -/// Type-safe JS Promises @JS('Promise') -@staticInterop -abstract class Promise { - /// A constructor for a JS promise - external factory Promise(PromiseExecutor executor); -} +external JSAny get _promiseConstructor; + +JSPromise createPromise(JSFunction executor) => + js_util.callConstructor( + _promiseConstructor, + [executor], + ); -/// The type of function that is used to create a Promise -typedef PromiseExecutor = void Function(PromiseResolver resolve, PromiseRejecter reject); -Promise futureToPromise(Future future) { - return Promise(js_util.allowInterop((PromiseResolver resolver, PromiseRejecter rejecter) { +JSPromise futureToPromise(Future future) { + return createPromise((JSFunction resolver, JSFunction rejecter) { future.then( - (T value) => resolver.resolve(value), + (T value) => resolver.call(null, value), onError: (Object? error) { printWarning('Rejecting promise with error: $error'); - rejecter.reject(error); + rejecter.call(null, null); }); - })); + }.toJS); } diff --git a/lib/web_ui/lib/src/engine/safe_browser_api.dart b/lib/web_ui/lib/src/engine/safe_browser_api.dart index a8359793fe53e..73ba4775ac169 100644 --- a/lib/web_ui/lib/src/engine/safe_browser_api.dart +++ b/lib/web_ui/lib/src/engine/safe_browser_api.dart @@ -196,20 +196,6 @@ bool get _defaultBrowserSupportsImageDecoder => // enable it explicitly. bool get _isBrowserImageDecoderStable => browserEngine == BrowserEngine.blink; -/// The signature of the function passed to the constructor of JavaScript `Promise`. -typedef JsPromiseCallback = void Function(void Function(Object? value) resolve, void Function(Object? error) reject); - -/// Corresponds to JavaScript's `Promise`. -/// -/// This type doesn't need any members. Instead, it should be first converted -/// to Dart's [Future] using [promiseToFuture] then interacted with through the -/// [Future] API. -@JS('window.Promise') -@staticInterop -class JsPromise { - external factory JsPromise(JsPromiseCallback callback); -} - /// Corresponds to the browser's `ImageDecoder` type. /// /// See also: @@ -228,7 +214,7 @@ extension ImageDecoderExtension on ImageDecoder { external JSBoolean get _complete; bool get complete => _complete.toDart; - external JsPromise decode(DecodeOptions options); + external JSPromise decode(DecodeOptions options); external JSVoid close(); } @@ -302,8 +288,8 @@ extension VideoFrameExtension on VideoFrame { double allocationSize() => _allocationSize().toDartDouble; @JS('copyTo') - external JsPromise _copyTo(JSAny destination); - JsPromise copyTo(Object destination) => _copyTo(destination.toJSAnyShallow); + external JSPromise _copyTo(JSAny destination); + JSPromise copyTo(Object destination) => _copyTo(destination.toJSAnyShallow); @JS('format') external JSString? get _format; @@ -344,7 +330,7 @@ extension VideoFrameExtension on VideoFrame { class ImageTrackList {} extension ImageTrackListExtension on ImageTrackList { - external JsPromise get ready; + external JSPromise get ready; external ImageTrack? get selectedTrack; } diff --git a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart index 7cc6081747d62..514ad95ded270 100644 --- a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart +++ b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart @@ -1847,8 +1847,8 @@ void _paragraphTests() { }, skip: isFirefox); // Intended: Headless firefox has no webgl support https://github.com/flutter/flutter/issues/109265 group('getCanvasKitJsFileNames', () { - dynamic oldV8BreakIterator = v8BreakIterator; - dynamic oldIntlSegmenter = intlSegmenter; + JSAny? oldV8BreakIterator = v8BreakIterator; + JSAny? oldIntlSegmenter = intlSegmenter; setUp(() { oldV8BreakIterator = v8BreakIterator; @@ -1861,8 +1861,8 @@ void _paragraphTests() { }); test('in Chromium-based browsers', () { - v8BreakIterator = Object(); // Any non-null value. - intlSegmenter = Object(); // Any non-null value. + v8BreakIterator = Object().toJSBox; // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. browserSupportsImageDecoder = true; expect(getCanvasKitJsFileNames(CanvasKitVariant.full), ['canvaskit.js']); @@ -1874,7 +1874,7 @@ void _paragraphTests() { }); test('in older versions of Chromium-based browsers', () { - v8BreakIterator = Object(); // Any non-null value. + v8BreakIterator = Object().toJSBox; // Any non-null value. intlSegmenter = null; // Older versions of Chromium didn't have the Intl.Segmenter API. browserSupportsImageDecoder = true; @@ -1884,7 +1884,7 @@ void _paragraphTests() { }); test('in other browsers', () { - intlSegmenter = Object(); // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. v8BreakIterator = null; browserSupportsImageDecoder = true; @@ -1892,7 +1892,7 @@ void _paragraphTests() { expect(getCanvasKitJsFileNames(CanvasKitVariant.chromium), ['chromium/canvaskit.js']); expect(getCanvasKitJsFileNames(CanvasKitVariant.auto), ['canvaskit.js']); - v8BreakIterator = Object(); + v8BreakIterator = Object().toJSBox; browserSupportsImageDecoder = false; // TODO(mdebbar): we don't check image codecs for now. // https://github.com/flutter/flutter/issues/122331 @@ -1935,13 +1935,13 @@ void _paragraphTests() { @JS('window.Intl.v8BreakIterator') -external dynamic get v8BreakIterator; +external JSAny? get v8BreakIterator; @JS('window.Intl.v8BreakIterator') -external set v8BreakIterator(dynamic x); +external set v8BreakIterator(JSAny? x); @JS('window.Intl.Segmenter') -external dynamic get intlSegmenter; +external JSAny? get intlSegmenter; @JS('window.Intl.Segmenter') -external set intlSegmenter(dynamic x); +external set intlSegmenter(JSAny? x); diff --git a/lib/web_ui/test/engine/app_bootstrap_test.dart b/lib/web_ui/test/engine/app_bootstrap_test.dart index 609c569883bb6..925d8448248bb 100644 --- a/lib/web_ui/test/engine/app_bootstrap_test.dart +++ b/lib/web_ui/test/engine/app_bootstrap_test.dart @@ -88,9 +88,17 @@ void testMain() { final FlutterEngineInitializer engineInitializer = bootstrap.prepareEngineInitializer(); - final Object appInitializer = await promiseToFuture(callMethod(engineInitializer, 'initializeEngine', [])); - final Object maybeApp = await promiseToFuture(callMethod(appInitializer, 'runApp', [])); - + final Object appInitializer = await promiseToFuture(callMethod( + engineInitializer, + 'initializeEngine', + [] + )); + expect(appInitializer, isA()); + final Object maybeApp = await promiseToFuture(callMethod( + appInitializer, + 'runApp', + [] + )); expect(maybeApp, isA()); expect(initCalled, 1, reason: 'initEngine should have been called.'); expect(runCalled, 2, reason: 'runApp should have been called.'); diff --git a/lib/web_ui/test/engine/browser_detect_test.dart b/lib/web_ui/test/engine/browser_detect_test.dart index 26b742e00d3a6..e3b17cacd7f79 100644 --- a/lib/web_ui/test/engine/browser_detect_test.dart +++ b/lib/web_ui/test/engine/browser_detect_test.dart @@ -157,8 +157,8 @@ void testMain() { }); group('browserSupportsCanvasKitChromium', () { - dynamic oldV8BreakIterator = v8BreakIterator; - dynamic oldIntlSegmenter = intlSegmenter; + JSAny? oldV8BreakIterator = v8BreakIterator; + JSAny? oldIntlSegmenter = intlSegmenter; setUp(() { oldV8BreakIterator = v8BreakIterator; @@ -171,16 +171,16 @@ void testMain() { }); test('Detect browsers that support CanvasKit Chromium', () { - v8BreakIterator = Object(); // Any non-null value. - intlSegmenter = Object(); // Any non-null value. + v8BreakIterator = Object().toJSBox; // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. browserSupportsImageDecoder = true; expect(browserSupportsCanvaskitChromium, isTrue); }); test('Detect browsers that do not support image codecs', () { - v8BreakIterator = Object(); // Any non-null value. - intlSegmenter = Object(); // Any non-null value. + v8BreakIterator = Object().toJSBox; // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. browserSupportsImageDecoder = false; // TODO(mdebbar): we don't check image codecs for now. @@ -190,7 +190,7 @@ void testMain() { test('Detect browsers that do not support v8BreakIterator', () { v8BreakIterator = null; - intlSegmenter = Object(); // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. browserSupportsImageDecoder = true; expect(browserSupportsCanvaskitChromium, isFalse); @@ -198,14 +198,14 @@ void testMain() { test('Detect browsers that support neither', () { v8BreakIterator = null; - intlSegmenter = Object(); // Any non-null value. + intlSegmenter = Object().toJSBox; // Any non-null value. browserSupportsImageDecoder = false; expect(browserSupportsCanvaskitChromium, isFalse); }); test('Detect browsers that support v8BreakIterator but no Intl.Segmenter', () { - v8BreakIterator = Object(); // Any non-null value. + v8BreakIterator = Object().toJSBox; // Any non-null value. intlSegmenter = null; expect(browserSupportsCanvaskitChromium, isFalse); @@ -222,13 +222,13 @@ void testMain() { } @JS('window.Intl.v8BreakIterator') -external dynamic get v8BreakIterator; +external JSAny? get v8BreakIterator; @JS('window.Intl.v8BreakIterator') -external set v8BreakIterator(dynamic x); +external set v8BreakIterator(JSAny? x); @JS('window.Intl.Segmenter') -external dynamic get intlSegmenter; +external JSAny? get intlSegmenter; @JS('window.Intl.Segmenter') -external set intlSegmenter(dynamic x); +external set intlSegmenter(JSAny? x); diff --git a/lib/web_ui/test/engine/initialization_test.dart b/lib/web_ui/test/engine/initialization_test.dart index 0068628b88d66..166efdc8129c8 100644 --- a/lib/web_ui/test/engine/initialization_test.dart +++ b/lib/web_ui/test/engine/initialization_test.dart @@ -15,13 +15,13 @@ external set _loader(JSAny? loader); set loader(Object? l) => _loader = l?.toJSAnyShallow; @JS('_flutter.loader.didCreateEngineInitializer') -external set didCreateEngineInitializer(Object? callback); +external set didCreateEngineInitializer(JSFunction? callback); void main() { // Prepare _flutter.loader.didCreateEngineInitializer, so it's ready in the page ASAP. loader = js_util.jsify({ 'loader': { - 'didCreateEngineInitializer': js_util.allowInterop(() { print('not mocked'); }), + 'didCreateEngineInitializer': () { print('not mocked'); }.toJS, }, }); internalBootstrapBrowserTest(() => testMain); @@ -29,14 +29,15 @@ void main() { void testMain() { test('bootstrapEngine calls _flutter.loader.didCreateEngineInitializer callback', () async { - Object? engineInitializer; + JSAny? engineInitializer; - void didCreateEngineInitializerMock(Object? obj) { + void didCreateEngineInitializerMock(JSAny? obj) { + print('obj: $obj'); engineInitializer = obj; } // Prepare the DOM for: _flutter.loader.didCreateEngineInitializer - didCreateEngineInitializer = js_util.allowInterop(didCreateEngineInitializerMock); + didCreateEngineInitializer = didCreateEngineInitializerMock.toJS; // Reset the engine engine.debugResetEngineInitializationState(); diff --git a/lib/web_ui/test/engine/window_test.dart b/lib/web_ui/test/engine/window_test.dart index 85f40e1662c3a..df39afb17adde 100644 --- a/lib/web_ui/test/engine/window_test.dart +++ b/lib/web_ui/test/engine/window_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:js_interop'; import 'dart:js_util' as js_util; import 'dart:typed_data'; @@ -331,19 +332,18 @@ Future testMain() async { // The `orientation` property cannot be overridden, so this test overrides the entire `screen`. js_util.setProperty(domWindow, 'screen', js_util.jsify({ 'orientation': { - 'lock': allowInterop((String lockType) { + 'lock': (String lockType) { lockCalls.add(lockType); - return Promise(allowInterop((PromiseResolver resolve, PromiseRejecter reject) { - if (!simulateError) { - resolve.resolve(null); - } else { - reject.reject('Simulating error'); + return futureToPromise(() async { + if (simulateError) { + throw Error(); } - })); - }), - 'unlock': allowInterop(() { + return 0.toJS; + }()); + }.toJS, + 'unlock': () { unlockCount += 1; - }), + }.toJS, }, })); From 968ea4f22fb3754f9b8d6553d60632405c38c812 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll Date: Tue, 12 Sep 2023 15:04:48 -0400 Subject: [PATCH 4/6] Roll Skia from a4f8f5177c8b to 211d63b1e1f5 (2 revisions) (#45724) https://skia.googlesource.com/skia.git/+log/a4f8f5177c8b..211d63b1e1f5 2023-09-12 brianosman@google.com Add basic support for kRGBA_10x6_SkColorType 2023-09-12 michaelludwig@google.com Use over-sampling to avoid branches in 2D blur effect If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/skia-flutter-autoroll Please CC bdero@google.com,brianosman@google.com,jmbetancourt@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --- DEPS | 2 +- ci/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6cd20a1985a23..cbedf4824d40e 100644 --- a/DEPS +++ b/DEPS @@ -18,7 +18,7 @@ vars = { 'llvm_git': 'https://llvm.googlesource.com', # OCMock is for testing only so there is no google clone 'ocmock_git': 'https://github.com/erikdoe/ocmock.git', - 'skia_revision': 'a4f8f5177c8b14f8a7ed3b6857b13509649eaf94', + 'skia_revision': '211d63b1e1f5271c62429756fc098d6d3f29f067', # WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY # See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. diff --git a/ci/licenses_golden/licenses_skia b/ci/licenses_golden/licenses_skia index d176ef10d3bf9..a2bf1d83dbed6 100644 --- a/ci/licenses_golden/licenses_skia +++ b/ci/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 970fdf70ba253a7a0cb72f11656de999 +Signature: 04eabdcfc5d1419543a85643fda5a077 ==================================================================================================== LIBRARY: etc1 From eab8b7113739996cd114905d38122d27541dd24b Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Tue, 12 Sep 2023 12:17:01 -0700 Subject: [PATCH 5/6] Reland "Build iOS unittest target in unopt builds" (#44356)"" (#45346)" (#45519) Reland https://github.com/flutter/engine/pull/44821 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- BUILD.gn | 4 + shell/platform/darwin/ios/BUILD.gn | 2 +- .../Source/FlutterChannelKeyResponderTest.mm | 15 +- .../Source/FlutterEmbedderKeyResponderTest.mm | 6 +- .../Source/FlutterEngineGroupTest.mm | 1 + .../framework/Source/FlutterEngineTest_mrc.mm | 1 + .../framework/Source/FlutterFakeKeyEvents.h | 31 +++-- .../framework/Source/FlutterFakeKeyEvents.mm | 5 + .../Source/FlutterKeyboardManagerTest.mm | 2 + .../Source/FlutterPlatformViewsTest.mm | 131 +++++++++--------- .../Source/FlutterTextureRegistryRelayTest.mm | 1 + .../Source/FlutterUndoManagerPluginTest.mm | 2 +- .../Source/FlutterViewControllerTest.mm | 22 +-- .../Source/FlutterViewControllerTest_mrc.mm | 84 +++++------ .../ios/framework/Source/FlutterViewTest.mm | 15 +- .../framework/Source/SemanticsObjectTest.mm | 20 +-- .../framework/Source/VsyncWaiterIosTest.mm | 9 +- .../Source/accessibility_bridge_test.mm | 6 +- .../ios/platform_message_handler_ios_test.mm | 2 +- 19 files changed, 188 insertions(+), 171 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 05fbbb093360a..704c0f2c8628d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -149,6 +149,10 @@ group("unittests") { [ "//flutter/shell/platform/android:flutter_shell_native_unittests" ] } + if (is_ios) { + public_deps += [ "//flutter/shell/platform/darwin/ios:ios_test_flutter" ] + } + # Compile all unittests targets if enabled. if (enable_unittests) { public_deps += [ diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index f726f41f23a95..fe180c2af422f 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -270,7 +270,7 @@ source_set("ios_test_flutter_mrc") { shared_library("ios_test_flutter") { testonly = true - visibility = [ ":*" ] + visibility = [ "*" ] cflags = [ "-fvisibility=default", "-F$platform_frameworks_path", diff --git a/shell/platform/darwin/ios/framework/Source/FlutterChannelKeyResponderTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterChannelKeyResponderTest.mm index fcdcb37cb0b0d..16b26ceabd601 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterChannelKeyResponderTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterChannelKeyResponderTest.mm @@ -16,10 +16,7 @@ XCTAssertTrue([value isEqualToString:expected], \ @"String \"%@\" not equal to the expected value of \"%@\"", value, expected) -namespace { -API_AVAILABLE(ios(13.4)) -constexpr UIKeyboardHIDUsage keyACode = (UIKeyboardHIDUsage)0x4; // KeyA iOS scan code. -} // namespace +using namespace flutter::testing; API_AVAILABLE(ios(13.4)) @interface FlutterChannelKeyResponderTest : XCTestCase @@ -35,8 +32,8 @@ - (void)setUp { } else { XCTSkip(@"Required API not present for test."); } - _testKeyDownEvent = keyDownEvent(keyACode, 0x0, 0.0f, "a", "a"); - _testKeyUpEvent = keyUpEvent(keyACode, 0x0, 0.0f); + _testKeyDownEvent = keyDownEvent(UIKeyboardHIDUsageKeyboardA, 0x0, 0.0f, "a", "a"); + _testKeyUpEvent = keyUpEvent(UIKeyboardHIDUsageKeyboardA, 0x0, 0.0f); } - (void)tearDown API_AVAILABLE(ios(13.4)) { @@ -76,7 +73,7 @@ - (void)testBasicKeyEvent API_AVAILABLE(ios(13.4)) { XCTAssertEqual([messages count], 1u); XCTAssertStrEqual([messages lastObject][@"keymap"], @"ios"); XCTAssertStrEqual([messages lastObject][@"type"], @"keydown"); - XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], keyACode); + XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], UIKeyboardHIDUsageKeyboardA); XCTAssertEqual([[messages lastObject][@"modifiers"] intValue], 0x0); XCTAssertStrEqual([messages lastObject][@"characters"], @"a"); XCTAssertStrEqual([messages lastObject][@"charactersIgnoringModifiers"], @"a"); @@ -97,7 +94,7 @@ - (void)testBasicKeyEvent API_AVAILABLE(ios(13.4)) { XCTAssertEqual([messages count], 1u); XCTAssertStrEqual([messages lastObject][@"keymap"], @"ios"); XCTAssertStrEqual([messages lastObject][@"type"], @"keyup"); - XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], keyACode); + XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], UIKeyboardHIDUsageKeyboardA); XCTAssertEqual([[messages lastObject][@"modifiers"] intValue], 0x0); XCTAssertEqual([responses count], 1u); @@ -134,7 +131,7 @@ - (void)testEmptyResponseIsTakenAsHandled API_AVAILABLE(ios(13.4)) { XCTAssertEqual([messages count], 1u); XCTAssertStrEqual([messages lastObject][@"keymap"], @"ios"); XCTAssertStrEqual([messages lastObject][@"type"], @"keydown"); - XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], keyACode); + XCTAssertEqual([[messages lastObject][@"keyCode"] intValue], UIKeyboardHIDUsageKeyboardA); XCTAssertEqual([[messages lastObject][@"modifiers"] intValue], 0x0); XCTAssertStrEqual([messages lastObject][@"characters"], @"a"); XCTAssertStrEqual([messages lastObject][@"charactersIgnoringModifiers"], @"a"); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEmbedderKeyResponderTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEmbedderKeyResponderTest.mm index f29d3b2d13664..0aac9fdaf3926 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEmbedderKeyResponderTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEmbedderKeyResponderTest.mm @@ -15,6 +15,7 @@ #include "flutter/shell/platform/embedder/test_utils/key_codes.g.h" using namespace flutter::testing::keycodes; +using namespace flutter::testing; FLUTTER_ASSERT_ARC; @@ -43,7 +44,7 @@ - (instancetype)initWithEvent:(const FlutterKeyEvent*)event if (event->character != nullptr) { size_t len = strlen(event->character); char* character = new char[len + 1]; - strcpy(character, event->character); + strlcpy(character, event->character, len + 1); _data->character = character; } _callback = callback; @@ -63,8 +64,9 @@ - (void)respond:(BOOL)handled { } - (void)dealloc { - if (_data->character != nullptr) + if (_data->character != nullptr) { delete[] _data->character; + } delete _data; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm index db43205c051f8..77929ea6b4c20 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineGroupTest.mm @@ -132,6 +132,7 @@ - (void)testReleasesProjectOnDealloc { FlutterDartProject* mockProject = OCMClassMock([FlutterDartProject class]); FlutterEngineGroup* group = [[FlutterEngineGroup alloc] initWithName:@"foo" project:mockProject]; + XCTAssertNotNil(group); weakProject = mockProject; XCTAssertNotNil(weakProject); group = nil; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest_mrc.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest_mrc.mm index 1acf3755f07b5..35ad2c4c21bbb 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest_mrc.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest_mrc.mm @@ -60,6 +60,7 @@ - (void)testEnableSemanticsWhenFlutterViewAccessibilityDidCall { engine.ensureSemanticsEnabledCalled = NO; [engine flutterViewAccessibilityDidCall]; XCTAssertTrue(engine.ensureSemanticsEnabledCalled); + [engine release]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h b/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h index 387ec5a7bb6af..d2996c1e4a5b2 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h @@ -47,26 +47,29 @@ API_AVAILABLE(ios(13.4)) @property(readwrite, nonatomic) NSString* dataCharactersIgnoringModifiers; @end -FlutterUIPressProxy* keyDownEvent(UIKeyboardHIDUsage keyCode, - UIKeyModifierFlags modifierFlags = 0x0, - NSTimeInterval timestamp = 0.0f, - const char* characters = "", - const char* charactersIgnoringModifiers = "") +namespace flutter { +namespace testing { +extern FlutterUIPressProxy* keyDownEvent(UIKeyboardHIDUsage keyCode, + UIKeyModifierFlags modifierFlags = 0x0, + NSTimeInterval timestamp = 0.0f, + const char* characters = "", + const char* charactersIgnoringModifiers = "") API_AVAILABLE(ios(13.4)); -FlutterUIPressProxy* keyUpEvent(UIKeyboardHIDUsage keyCode, - UIKeyModifierFlags modifierFlags = 0x0, - NSTimeInterval timestamp = 0.0f, - const char* characters = "", - const char* charactersIgnoringModifiers = "") - API_AVAILABLE(ios(13.4)); - -FlutterUIPressProxy* keyEventWithPhase(UIPressPhase phase, - UIKeyboardHIDUsage keyCode, +extern FlutterUIPressProxy* keyUpEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags = 0x0, NSTimeInterval timestamp = 0.0f, const char* characters = "", const char* charactersIgnoringModifiers = "") API_AVAILABLE(ios(13.4)); +extern FlutterUIPressProxy* keyEventWithPhase(UIPressPhase phase, + UIKeyboardHIDUsage keyCode, + UIKeyModifierFlags modifierFlags = 0x0, + NSTimeInterval timestamp = 0.0f, + const char* characters = "", + const char* charactersIgnoringModifiers = "") + API_AVAILABLE(ios(13.4)); +} // namespace testing +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_FAKE_KEY_EVENTS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.mm b/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.mm index abbdbc062632a..aaca2b898581a 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.mm @@ -84,6 +84,9 @@ - (NSString*)charactersIgnoringModifiers API_AVAILABLE(ios(13.4)) { } @end +namespace flutter { +namespace testing { + FlutterUIPressProxy* keyDownEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags, NSTimeInterval timestamp, @@ -123,3 +126,5 @@ - (NSString*)charactersIgnoringModifiers API_AVAILABLE(ios(13.4)) { type:UIEventTypePresses timestamp:timestamp]; } +} // namespace testing +} // namespace flutter diff --git a/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm index 764a64b242cad..5568c38016db9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm @@ -21,6 +21,8 @@ class PointerDataPacket {}; } // namespace flutter +using namespace flutter::testing; + /// Sometimes we have to use a custom mock to avoid retain cycles in ocmock. @interface FlutterEnginePartialMock : FlutterEngine @property(nonatomic, strong) FlutterBasicMessageChannel* lifecycleChannel; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm index bba450217747a..1e6dad56089aa 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm @@ -125,7 +125,7 @@ void UpdateAssetResolverByType(std::unique_ptr updated_a } // namespace flutter namespace { -fml::RefPtr CreateNewThread(std::string name) { +fml::RefPtr CreateNewThread(const std::string& name) { auto thread = std::make_unique(name); auto runner = thread->GetTaskRunner(); return runner; @@ -155,7 +155,7 @@ - (void)testFlutterViewOnlyCreateOnceInOneFrame { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -211,7 +211,7 @@ - (void)testCanCreatePlatformViewWithoutFlutterView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -265,7 +265,7 @@ - (void)testApplyBackdropFilter { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -337,7 +337,7 @@ - (void)testApplyBackdropFilterWithCorrectFrame { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -409,7 +409,7 @@ - (void)testApplyMultipleBackdropFilters { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -482,7 +482,7 @@ - (void)testAddBackdropFilters { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -595,7 +595,7 @@ - (void)testRemoveBackdropFilters { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -732,7 +732,7 @@ - (void)testEditBackdropFilters { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1009,7 +1009,7 @@ - (void)testApplyBackdropFilterNotDlBlurImageFilter { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1208,29 +1208,29 @@ - (void)testApplyBackdropFilterCorrectAPI { // The gaussianBlur filter is extracted from UIVisualEffectView. // Each test requires a new PlatformViewFilter // Valid UIVisualEffectView API - UIVisualEffectView* visualEffectView = [[UIVisualEffectView alloc] - initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; + UIVisualEffectView* visualEffectView = [[[UIVisualEffectView alloc] + initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]] autorelease]; PlatformViewFilter* platformViewFilter = - [[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) - blurRadius:5 - visualEffectView:visualEffectView]; + [[[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) + blurRadius:5 + visualEffectView:visualEffectView] autorelease]; XCTAssertNotNil(platformViewFilter); } - (void)testApplyBackdropFilterAPIChangedInvalidUIVisualEffectView { [PlatformViewFilter resetPreparation]; - UIVisualEffectView* visualEffectView = [[UIVisualEffectView alloc] init]; + UIVisualEffectView* visualEffectView = [[[UIVisualEffectView alloc] init] autorelease]; PlatformViewFilter* platformViewFilter = - [[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) - blurRadius:5 - visualEffectView:visualEffectView]; + [[[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) + blurRadius:5 + visualEffectView:visualEffectView] autorelease]; XCTAssertNil(platformViewFilter); } - (void)testApplyBackdropFilterAPIChangedNoGaussianBlurFilter { [PlatformViewFilter resetPreparation]; - UIVisualEffectView* editedUIVisualEffectView = [[UIVisualEffectView alloc] - initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; + UIVisualEffectView* editedUIVisualEffectView = [[[UIVisualEffectView alloc] + initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]] autorelease]; NSArray* subviews = editedUIVisualEffectView.subviews; for (UIView* view in subviews) { if ([NSStringFromClass([view class]) hasSuffix:@"BackdropView"]) { @@ -1244,16 +1244,16 @@ - (void)testApplyBackdropFilterAPIChangedNoGaussianBlurFilter { } } PlatformViewFilter* platformViewFilter = - [[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) - blurRadius:5 - visualEffectView:editedUIVisualEffectView]; + [[[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) + blurRadius:5 + visualEffectView:editedUIVisualEffectView] autorelease]; XCTAssertNil(platformViewFilter); } - (void)testApplyBackdropFilterAPIChangedInvalidInputRadius { [PlatformViewFilter resetPreparation]; - UIVisualEffectView* editedUIVisualEffectView = [[UIVisualEffectView alloc] - initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; + UIVisualEffectView* editedUIVisualEffectView = [[[UIVisualEffectView alloc] + initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]] autorelease]; NSArray* subviews = editedUIVisualEffectView.subviews; for (UIView* view in subviews) { if ([NSStringFromClass([view class]) hasSuffix:@"BackdropView"]) { @@ -1268,20 +1268,20 @@ - (void)testApplyBackdropFilterAPIChangedInvalidInputRadius { } PlatformViewFilter* platformViewFilter = - [[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) - blurRadius:5 - visualEffectView:editedUIVisualEffectView]; + [[[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) + blurRadius:5 + visualEffectView:editedUIVisualEffectView] autorelease]; XCTAssertNil(platformViewFilter); } - (void)testBackdropFilterVisualEffectSubviewBackgroundColor { - UIVisualEffectView* visualEffectView = [[UIVisualEffectView alloc] - initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; + UIVisualEffectView* visualEffectView = [[[UIVisualEffectView alloc] + initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]] autorelease]; PlatformViewFilter* platformViewFilter = - [[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) - blurRadius:5 - visualEffectView:visualEffectView]; - CGColorRef visualEffectSubviewBackgroundColor; + [[[PlatformViewFilter alloc] initWithFrame:CGRectMake(0, 0, 10, 10) + blurRadius:5 + visualEffectView:visualEffectView] autorelease]; + CGColorRef visualEffectSubviewBackgroundColor = nil; for (UIView* view in [platformViewFilter backdropFilterView].subviews) { if ([NSStringFromClass([view class]) hasSuffix:@"VisualEffectSubview"]) { visualEffectSubviewBackgroundColor = view.layer.backgroundColor; @@ -1309,7 +1309,7 @@ - (void)testCompositePlatformView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1365,7 +1365,7 @@ - (void)testBackdropFilterCorrectlyPushedAndReset { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1459,7 +1459,7 @@ - (void)testChildClippingViewShouldBeTheBoundingRectOfPlatformView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1530,7 +1530,7 @@ - (void)testClipsDoNotInterceptWithPlatformViewShouldNotAddMaskView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1597,7 +1597,7 @@ - (void)testClipRRectOnlyHasCornersInterceptWithPlatformViewShouldAddMaskView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1663,7 +1663,7 @@ - (void)testClipRect { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1736,7 +1736,7 @@ - (void)testClipRRect { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1809,7 +1809,7 @@ - (void)testClipPath { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1883,7 +1883,7 @@ - (void)testSetFlutterViewControllerAfterCreateCanStillDispatchTouchEvents { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -1947,7 +1947,7 @@ - (void)testSetFlutterViewControllerInTheMiddleOfTouchEventShouldStillAllowGestu /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2068,7 +2068,7 @@ - (void)testSetFlutterViewControllerInTheMiddleOfTouchEventShouldStillAllowGestu /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2179,7 +2179,7 @@ - (void)testFlutterPlatformViewTouchesCancelledEventAreForcedToBeCancelled { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2241,7 +2241,7 @@ - (void)testFlutterPlatformViewControllerSubmitFrameWithoutFlutterViewNotCrashin /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2306,7 +2306,7 @@ - (void)testFlutterPlatformViewControllerSubmitFrameWithoutFlutterViewNotCrashin flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2356,7 +2356,7 @@ - (void)testFlutterPlatformViewControllerBeginFrameShouldResetCompisitionOrder { flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2412,7 +2412,7 @@ - (void)testFlutterPlatformViewControllerBeginFrameShouldResetCompisitionOrder { flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2510,7 +2510,7 @@ - (void)testFlutterPlatformViewControllerBeginFrameShouldResetCompisitionOrder { flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2608,7 +2608,7 @@ - (void)testThreadMergeAtEndFrame { flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2645,8 +2645,8 @@ - (void)testThreadMergeAtEndFrame { // Unmerge threads before the end of the test // TaskRunners are required to be unmerged before destruction. - while (raster_thread_merger->DecrementLease() != fml::RasterThreadStatus::kUnmergedNow) - ; + while (raster_thread_merger->DecrementLease() != fml::RasterThreadStatus::kUnmergedNow) { + } } - (int)alphaOfPoint:(CGPoint)point onView:(UIView*)view { @@ -2668,8 +2668,8 @@ - (int)alphaOfPoint:(CGPoint)point onView:(UIView*)view { - (void)testHasFirstResponderInViewHierarchySubtree_viewItselfBecomesFirstResponder { // For view to become the first responder, it must be a descendant of a UIWindow - UIWindow* window = [[UIWindow alloc] init]; - UITextField* textField = [[UITextField alloc] init]; + UIWindow* window = [[[UIWindow alloc] init] autorelease]; + UITextField* textField = [[[UITextField alloc] init] autorelease]; [window addSubview:textField]; [textField becomeFirstResponder]; @@ -2682,10 +2682,10 @@ - (void)testHasFirstResponderInViewHierarchySubtree_viewItselfBecomesFirstRespon - (void)testHasFirstResponderInViewHierarchySubtree_descendantViewBecomesFirstResponder { // For view to become the first responder, it must be a descendant of a UIWindow - UIWindow* window = [[UIWindow alloc] init]; - UIView* view = [[UIView alloc] init]; - UIView* childView = [[UIView alloc] init]; - UITextField* textField = [[UITextField alloc] init]; + UIWindow* window = [[[UIWindow alloc] init] autorelease]; + UIView* view = [[[UIView alloc] init] autorelease]; + UIView* childView = [[[UIView alloc] init] autorelease]; + UITextField* textField = [[[UITextField alloc] init] autorelease]; [window addSubview:view]; [view addSubview:childView]; [childView addSubview:textField]; @@ -2738,6 +2738,7 @@ - (void)testMaskViewsReleasedWhenPoolIsReleased { // The only retain left is our manual retain called inside the autorelease pool, meaning the // maskViews are dealloc'd. XCTAssertEqual(retainedView.retainCount, 1u); + [retainedView release]; } - (void)testClipMaskViewIsReused { @@ -2758,7 +2759,7 @@ - (void)testClipMaskViewIsReused { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2840,7 +2841,7 @@ - (void)testDifferentClipMaskViewIsUsedForEachView { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -2943,7 +2944,7 @@ - (void)testDisposingViewInCompositionOrderDoNotCrash { flutterPlatformViewsController->SetFlutterView(mockFlutterView); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -3048,7 +3049,7 @@ - (void)testOnlyPlatformViewsAreRemovedWhenReset { /*is_gpu_disabled_sync_switch=*/nil); FlutterPlatformViewsTestMockFlutterPlatformFactory* factory = - [[FlutterPlatformViewsTestMockFlutterPlatformFactory new] autorelease]; + [[[FlutterPlatformViewsTestMockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm index 36b473dea8acd..790b484075e3f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm @@ -61,6 +61,7 @@ - (void)testRetainCycle { weakEngine = engine; } XCTAssertNil(weakEngine); + XCTAssertNotNil(strongRelay); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPluginTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPluginTest.mm index 0a30cb1dfb871..24f9bba023582 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPluginTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPluginTest.mm @@ -41,7 +41,7 @@ - (void)setUp { self.undoManagerPlugin = [[FlutterUndoManagerPluginForTest alloc] initWithDelegate:self.engine]; - self.viewController = [FlutterViewController new]; + self.viewController = [[FlutterViewController alloc] init]; self.undoManagerPlugin.viewController = self.viewController; self.undoManager = OCMClassMock([NSUndoManager class]); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index e348978f51010..35ffaac68bfbe 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -22,6 +22,8 @@ FLUTTER_ASSERT_ARC +using namespace flutter::testing; + @interface FlutterEngine () - (FlutterTextInputPlugin*)textInputPlugin; - (void)sendKeyEvent:(const FlutterKeyEvent&)event @@ -57,8 +59,9 @@ - (void)notifyLowMemory { - (void)sendKeyEvent:(const FlutterKeyEvent&)event callback:(FlutterKeyEventCallback)callback userData:(void*)userData API_AVAILABLE(ios(9.0)) { - if (callback == nil) + if (callback == nil) { return; + } // NSAssert(callback != nullptr, @"Invalid callback"); // Response is async, so we have to post it to the run loop instead of calling // it directly. @@ -1179,10 +1182,6 @@ - (void)testItReportsDarkPlatformBrightnessWhenTraitCollectionRequestsIt { // Setup test. id settingsChannel = OCMClassMock([FlutterBasicMessageChannel class]); OCMStub([self.mockEngine settingsChannel]).andReturn(settingsChannel); - - FlutterViewController* realVC = [[FlutterViewController alloc] initWithEngine:self.mockEngine - nibName:nil - bundle:nil]; id mockTraitCollection = [self fakeTraitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; @@ -1190,7 +1189,9 @@ - (void)testItReportsDarkPlatformBrightnessWhenTraitCollectionRequestsIt { // the UITraitCollection of our choice. Mocking the object under test is not // desirable, but given that the OS does not offer a DI approach to providing // our own UITraitCollection, this seems to be the least bad option. - id partialMockVC = OCMPartialMock(realVC); + id partialMockVC = OCMPartialMock([[FlutterViewController alloc] initWithEngine:self.mockEngine + nibName:nil + bundle:nil]); OCMStub([partialMockVC traitCollection]).andReturn(mockTraitCollection); // Exercise behavior under test. @@ -1283,16 +1284,15 @@ - (void)testItReportsHighContrastWhenTraitCollectionRequestsIt { id settingsChannel = OCMClassMock([FlutterBasicMessageChannel class]); OCMStub([self.mockEngine settingsChannel]).andReturn(settingsChannel); - FlutterViewController* realVC = [[FlutterViewController alloc] initWithEngine:self.mockEngine - nibName:nil - bundle:nil]; id mockTraitCollection = [self fakeTraitCollectionWithContrast:UIAccessibilityContrastHigh]; // We partially mock the real FlutterViewController to act as the OS and report // the UITraitCollection of our choice. Mocking the object under test is not // desirable, but given that the OS does not offer a DI approach to providing // our own UITraitCollection, this seems to be the least bad option. - id partialMockVC = OCMPartialMock(realVC); + id partialMockVC = OCMPartialMock([[FlutterViewController alloc] initWithEngine:self.mockEngine + nibName:nil + bundle:nil]); OCMStub([partialMockVC traitCollection]).andReturn(mockTraitCollection); // Exercise behavior under test. @@ -1575,6 +1575,7 @@ - (void)testWillDeallocNotification { [[XCTestExpectation alloc] initWithDescription:@"notification called"]; id engine = [[MockEngine alloc] init]; @autoreleasepool { + // NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores) FlutterViewController* realVC = [[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil]; @@ -1584,6 +1585,7 @@ - (void)testWillDeallocNotification { usingBlock:^(NSNotification* _Nonnull note) { [expectation fulfill]; }]; + XCTAssertNotNil(realVC); realVC = nil; } [self waitForExpectations:@[ expectation ] timeout:1.0]; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest_mrc.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest_mrc.mm index bb691f033ee95..c0bd4ea9afe92 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest_mrc.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest_mrc.mm @@ -51,11 +51,10 @@ - (void)testSetupKeyboardAnimationVsyncClientWillCreateNewVsyncClientForFlutterV id mockDisplayLinkManager = [OCMockObject mockForClass:[DisplayLinkManager class]]; double maxFrameRate = 120; [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate]; - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; FlutterKeyboardAnimationCallback callback = ^(fml::TimePoint targetTime) { }; [viewController setUpKeyboardAnimationVsyncClient:callback]; @@ -76,11 +75,10 @@ - (void)testSetupKeyboardAnimationVsyncClientWillCreateNewVsyncClientForFlutterV id mockDisplayLinkManager = [OCMockObject mockForClass:[DisplayLinkManager class]]; double maxFrameRate = 120; [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate]; - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; [viewController createTouchRateCorrectionVSyncClientIfNeeded]; XCTAssertNotNil(viewController.touchRateCorrectionVSyncClient); } @@ -90,11 +88,10 @@ - (void)testCreateTouchRateCorrectionVSyncClientWillNotCreateNewVSyncClientWhenC double maxFrameRate = 120; [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate]; - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; [viewController createTouchRateCorrectionVSyncClientIfNeeded]; VSyncClient* clientBefore = viewController.touchRateCorrectionVSyncClient; XCTAssertNotNil(clientBefore); @@ -110,11 +107,10 @@ - (void)testCreateTouchRateCorrectionVSyncClientWillNotCreateVsyncClientWhenRefr id mockDisplayLinkManager = [OCMockObject mockForClass:[DisplayLinkManager class]]; double maxFrameRate = 60; [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate]; - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; [viewController createTouchRateCorrectionVSyncClientIfNeeded]; XCTAssertNil(viewController.touchRateCorrectionVSyncClient); } @@ -123,67 +119,72 @@ - (void)testTriggerTouchRateCorrectionVSyncClientCorrectly { id mockDisplayLinkManager = [OCMockObject mockForClass:[DisplayLinkManager class]]; double maxFrameRate = 120; [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate]; - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; [viewController loadView]; [viewController viewDidLoad]; VSyncClient* client = viewController.touchRateCorrectionVSyncClient; CADisplayLink* link = [client getDisplayLink]; - UITouch* fakeTouchBegan = [[UITouch alloc] init]; + UITouch* fakeTouchBegan = [[[UITouch alloc] init] autorelease]; fakeTouchBegan.phase = UITouchPhaseBegan; - UITouch* fakeTouchMove = [[UITouch alloc] init]; + UITouch* fakeTouchMove = [[[UITouch alloc] init] autorelease]; fakeTouchMove.phase = UITouchPhaseMoved; - UITouch* fakeTouchEnd = [[UITouch alloc] init]; + UITouch* fakeTouchEnd = [[[UITouch alloc] init] autorelease]; fakeTouchEnd.phase = UITouchPhaseEnded; - UITouch* fakeTouchCancelled = [[UITouch alloc] init]; + UITouch* fakeTouchCancelled = [[[UITouch alloc] init] autorelease]; fakeTouchCancelled.phase = UITouchPhaseCancelled; [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] initWithObjects:fakeTouchBegan, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] initWithObjects:fakeTouchBegan, nil] + autorelease]]; XCTAssertFalse(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] initWithObjects:fakeTouchEnd, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] initWithObjects:fakeTouchEnd, nil] + autorelease]]; XCTAssertTrue(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] initWithObjects:fakeTouchMove, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] initWithObjects:fakeTouchMove, nil] + autorelease]]; XCTAssertFalse(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] initWithObjects:fakeTouchCancelled, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] initWithObjects:fakeTouchCancelled, nil] + autorelease]]; XCTAssertTrue(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] - initWithObjects:fakeTouchBegan, fakeTouchEnd, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] + initWithObjects:fakeTouchBegan, fakeTouchEnd, nil] + autorelease]]; XCTAssertFalse(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] initWithObjects:fakeTouchEnd, - fakeTouchCancelled, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] + initWithObjects:fakeTouchEnd, fakeTouchCancelled, nil] + autorelease]]; XCTAssertTrue(link.isPaused); [viewController - triggerTouchRateCorrectionIfNeeded:[[NSSet alloc] - initWithObjects:fakeTouchMove, fakeTouchEnd, nil]]; + triggerTouchRateCorrectionIfNeeded:[[[NSSet alloc] + initWithObjects:fakeTouchMove, fakeTouchEnd, nil] + autorelease]]; XCTAssertFalse(link.isPaused); } - (void)testFlutterViewControllerStartKeyboardAnimationWillCreateVsyncClientCorrectly { - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; viewController.targetViewInsetBottom = 100; [viewController startKeyBoardAnimation:0.25]; XCTAssertNotNil(viewController.keyboardAnimationVSyncClient); @@ -191,11 +192,10 @@ - (void)testFlutterViewControllerStartKeyboardAnimationWillCreateVsyncClientCorr - (void) testSetupKeyboardAnimationVsyncClientWillNotCreateNewVsyncClientWhenKeyboardAnimationCallbackIsNil { - FlutterEngine* engine = [[FlutterEngine alloc] init]; + FlutterEngine* engine = [[[FlutterEngine alloc] init] autorelease]; [engine runWithEntrypoint:nil]; - FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine - nibName:nil - bundle:nil]; + FlutterViewController* viewController = + [[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease]; [viewController setUpKeyboardAnimationVsyncClient:nil]; XCTAssertNil(viewController.keyboardAnimationVSyncClient); } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewTest.mm index 23d9b2dc527e6..78f95210e37e6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewTest.mm @@ -43,23 +43,26 @@ @interface FlutterViewTest : XCTestCase @implementation FlutterViewTest - (void)testFlutterViewEnableSemanticsWhenIsAccessibilityElementIsCalled { - FakeDelegate* delegate = [[FakeDelegate alloc] init]; - FlutterView* view = [[FlutterView alloc] initWithDelegate:delegate opaque:NO enableWideGamut:NO]; + FakeDelegate* delegate = [[[FakeDelegate alloc] init] autorelease]; + FlutterView* view = [[[FlutterView alloc] initWithDelegate:delegate opaque:NO + enableWideGamut:NO] autorelease]; delegate.callbackCalled = NO; XCTAssertFalse(view.isAccessibilityElement); XCTAssertTrue(delegate.callbackCalled); } - (void)testFlutterViewBackgroundColorIsNotNil { - FakeDelegate* delegate = [[FakeDelegate alloc] init]; - FlutterView* view = [[FlutterView alloc] initWithDelegate:delegate opaque:NO enableWideGamut:NO]; + FakeDelegate* delegate = [[[FakeDelegate alloc] init] autorelease]; + FlutterView* view = [[[FlutterView alloc] initWithDelegate:delegate opaque:NO + enableWideGamut:NO] autorelease]; XCTAssertNotNil(view.backgroundColor); } - (void)testIgnoreWideColorWithoutImpeller { - FakeDelegate* delegate = [[FakeDelegate alloc] init]; + FakeDelegate* delegate = [[[FakeDelegate alloc] init] autorelease]; delegate.isUsingImpeller = NO; - FlutterView* view = [[FlutterView alloc] initWithDelegate:delegate opaque:NO enableWideGamut:YES]; + FlutterView* view = [[[FlutterView alloc] initWithDelegate:delegate opaque:NO + enableWideGamut:YES] autorelease]; [view layoutSubviews]; XCTAssertTrue([view.layer isKindOfClass:NSClassFromString(@"CAMetalLayer")]); CAMetalLayer* layer = (CAMetalLayer*)view.layer; diff --git a/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm b/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm index c2200af6a6881..2a3f7e799e40f 100644 --- a/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm +++ b/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm @@ -660,9 +660,11 @@ - (void)testFlutterScrollableSemanticsObjectWithLabelValueHintIsNotHiddenWhenVoi [scrollable accessibilityBridgeDidFinishUpdate]; UIScrollView* scrollView = [scrollable nativeAccessibility]; XCTAssertTrue(scrollView.isAccessibilityElement); - XCTAssertTrue([scrollView.accessibilityLabel isEqualToString:@"label"]); - XCTAssertTrue([scrollView.accessibilityValue isEqualToString:@"value"]); - XCTAssertTrue([scrollView.accessibilityHint isEqualToString:@"hint"]); + XCTAssertTrue( + [scrollView.accessibilityLabel isEqualToString:NSLocalizedString(@"label", @"test")]); + XCTAssertTrue( + [scrollView.accessibilityValue isEqualToString:NSLocalizedString(@"value", @"test")]); + XCTAssertTrue([scrollView.accessibilityHint isEqualToString:NSLocalizedString(@"hint", @"test")]); } - (void)testFlutterSemanticsObjectMergeTooltipToLabel { @@ -788,7 +790,7 @@ - (void)testSemanticsObjectBuildsAttributedString { FlutterSemanticsObject* object = [[FlutterSemanticsObject alloc] initWithBridge:bridge uid:0]; [object setSemanticsNode:&node]; NSMutableAttributedString* expectedAttributedLabel = - [[NSMutableAttributedString alloc] initWithString:@"label"]; + [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"label", @"test")]; NSDictionary* attributeDict = @{ UIAccessibilitySpeechAttributeSpellOut : @YES, }; @@ -797,7 +799,7 @@ - (void)testSemanticsObjectBuildsAttributedString { [object.accessibilityAttributedLabel isEqualToAttributedString:expectedAttributedLabel]); NSMutableAttributedString* expectedAttributedValue = - [[NSMutableAttributedString alloc] initWithString:@"value"]; + [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"value", @"test")]; attributeDict = @{ UIAccessibilitySpeechAttributeSpellOut : @YES, }; @@ -806,7 +808,7 @@ - (void)testSemanticsObjectBuildsAttributedString { [object.accessibilityAttributedValue isEqualToAttributedString:expectedAttributedValue]); NSMutableAttributedString* expectedAttributedHint = - [[NSMutableAttributedString alloc] initWithString:@"hint"]; + [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"hint", @"test")]; attributeDict = @{ UIAccessibilitySpeechAttributeLanguage : @"en-MX", }; @@ -935,7 +937,7 @@ - (void)testFlutterSwitchSemanticsObjectMatchesUISwitch { nativeSwitch.on = YES; XCTAssertEqual(object.accessibilityTraits, nativeSwitch.accessibilityTraits); - XCTAssertEqual(object.accessibilityValue, nativeSwitch.accessibilityValue); + XCTAssertEqualObjects(object.accessibilityValue, nativeSwitch.accessibilityValue); // Set the toggled to false; flutter::SemanticsNode update; @@ -947,7 +949,7 @@ - (void)testFlutterSwitchSemanticsObjectMatchesUISwitch { nativeSwitch.on = NO; XCTAssertEqual(object.accessibilityTraits, nativeSwitch.accessibilityTraits); - XCTAssertEqual(object.accessibilityValue, nativeSwitch.accessibilityValue); + XCTAssertEqualObjects(object.accessibilityValue, nativeSwitch.accessibilityValue); } - (void)testFlutterSemanticsObjectOfRadioButton { @@ -987,7 +989,7 @@ - (void)testFlutterSwitchSemanticsObjectMatchesUISwitchDisabled { nativeSwitch.enabled = NO; XCTAssertEqual(object.accessibilityTraits, nativeSwitch.accessibilityTraits); - XCTAssertEqual(object.accessibilityValue, nativeSwitch.accessibilityValue); + XCTAssertEqualObjects(object.accessibilityValue, nativeSwitch.accessibilityValue); } - (void)testSemanticsObjectDeallocated { diff --git a/shell/platform/darwin/ios/framework/Source/VsyncWaiterIosTest.mm b/shell/platform/darwin/ios/framework/Source/VsyncWaiterIosTest.mm index eace6585198ed..39fc0341fc7bc 100644 --- a/shell/platform/darwin/ios/framework/Source/VsyncWaiterIosTest.mm +++ b/shell/platform/darwin/ios/framework/Source/VsyncWaiterIosTest.mm @@ -13,7 +13,7 @@ FLUTTER_ASSERT_NOT_ARC namespace { -fml::RefPtr CreateNewThread(std::string name) { +fml::RefPtr CreateNewThread(const std::string& name) { auto thread = std::make_unique(name); auto runner = thread->GetTaskRunner(); return runner; @@ -48,8 +48,6 @@ - (void)testSetAllowPauseAfterVsyncCorrect { [vsyncClient await]; [vsyncClient onDisplayLink:link]; XCTAssertTrue(link.isPaused); - - [vsyncClient release]; } - (void)testSetCorrectVariableRefreshRates { @@ -72,7 +70,6 @@ - (void)testSetCorrectVariableRefreshRates { } else { XCTAssertEqualWithAccuracy(link.preferredFramesPerSecond, maxFrameRate, 0.1); } - [vsyncClient release]; } - (void)testDoNotSetVariableRefreshRatesIfCADisableMinimumFrameDurationOnPhoneIsNotOn { @@ -95,7 +92,6 @@ - (void)testDoNotSetVariableRefreshRatesIfCADisableMinimumFrameDurationOnPhoneIs } else { XCTAssertEqualWithAccuracy(link.preferredFramesPerSecond, 0, 0.1); } - [vsyncClient release]; } - (void)testDoNotSetVariableRefreshRatesIfCADisableMinimumFrameDurationOnPhoneIsNotSet { @@ -114,7 +110,6 @@ - (void)testDoNotSetVariableRefreshRatesIfCADisableMinimumFrameDurationOnPhoneIs } else { XCTAssertEqualWithAccuracy(link.preferredFramesPerSecond, 0, 0.1); } - [vsyncClient release]; } - (void)testAwaitAndPauseWillWorkCorrectly { @@ -132,8 +127,6 @@ - (void)testAwaitAndPauseWillWorkCorrectly { [vsyncClient pause]; XCTAssertTrue(link.isPaused); - - [vsyncClient release]; } - (void)testRefreshRateUpdatedTo80WhenThraedsMerge { diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm index 283d4fe02decd..ac44da5370b9d 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm @@ -125,7 +125,7 @@ void PostAccessibilityNotification(UIAccessibilityNotifications notification, } // namespace flutter namespace { -fml::RefPtr CreateNewThread(std::string name) { +fml::RefPtr CreateNewThread(const std::string& name) { auto thread = std::make_unique(name); auto runner = thread->GetTaskRunner(); return runner; @@ -288,7 +288,7 @@ - (void)testSemanticsDeallocated { std::string label = "some label"; flutterPlatformViewsController->SetFlutterView(mockFlutterView); - MockFlutterPlatformFactory* factory = [[MockFlutterPlatformFactory new] autorelease]; + MockFlutterPlatformFactory* factory = [[[MockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); @@ -342,7 +342,7 @@ - (void)testSemanticsDeallocatedWithoutLoadingView { /*worker_task_runner=*/nil, /*is_gpu_disabled_sync_switch=*/nil); - MockFlutterPlatformFactory* factory = [[MockFlutterPlatformFactory new] autorelease]; + MockFlutterPlatformFactory* factory = [[[MockFlutterPlatformFactory alloc] init] autorelease]; flutterPlatformViewsController->RegisterViewFactory( factory, @"MockFlutterPlatformView", FlutterPlatformViewGestureRecognizersBlockingPolicyEager); diff --git a/shell/platform/darwin/ios/platform_message_handler_ios_test.mm b/shell/platform/darwin/ios/platform_message_handler_ios_test.mm index 92164577651af..c1988bc2158f4 100644 --- a/shell/platform/darwin/ios/platform_message_handler_ios_test.mm +++ b/shell/platform/darwin/ios/platform_message_handler_ios_test.mm @@ -18,7 +18,7 @@ namespace { using namespace flutter; -fml::RefPtr CreateNewThread(std::string name) { +fml::RefPtr CreateNewThread(const std::string& name) { auto thread = std::make_unique(name); auto runner = thread->GetTaskRunner(); return runner; From c90fadf45d44167e338d957f04786527aa7a3f55 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll Date: Tue, 12 Sep 2023 15:58:57 -0400 Subject: [PATCH 6/6] Manual roll Dart SDK from 43d4b1373788 to 1ee7ef8bbc65 (6 revisions) (#45726) Manual roll requested by zra@google.com https://dart.googlesource.com/sdk.git/+log/43d4b1373788..1ee7ef8bbc65 2023-09-07 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-140.0.dev 2023-09-07 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-139.0.dev 2023-09-07 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-138.0.dev 2023-09-06 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-137.0.dev 2023-09-06 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-136.0.dev 2023-09-05 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.2.0-135.0.dev If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/dart-sdk-flutter-engine Please CC bdero@google.com,dart-vm-team@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --- DEPS | 40 +++++++++++++++---------------- ci/licenses_golden/excluded_files | 1 + ci/licenses_golden/licenses_dart | 12 +++------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/DEPS b/DEPS index cbedf4824d40e..be09170f46843 100644 --- a/DEPS +++ b/DEPS @@ -57,7 +57,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '43d4b1373788fb0a11e7700127b10f4bae1148c1', + 'dart_revision': '1ee7ef8bbc6543b851f805027e1ca64f4e7909bd', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py @@ -66,12 +66,12 @@ vars = { 'dart_boringssl_rev': '74646566e93de7551bfdfc5f49de7462f13d1d05', 'dart_browser_launcher_rev': '1f69393d63a2f8d36d00b86cdd20df70c347af82', 'dart_clock_rev': '1e75f08d3428bcd6f4b7cf70e788f24fc9b661e1', - 'dart_collection_rev': '1a9b7eb64be10a8ba4ced7eb36b4b265a49d5d41', + 'dart_collection_rev': '91afde43f488eef618454b896301c6ff59af72e0', 'dart_devtools_rev': 'acbc179425b4596b7c2ba7d9c4263077f2e18098', 'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb', 'dart_perfetto_rev': 'b8da07095979310818f0efde2ef3c69ea70d62c5', 'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10', - 'dart_protobuf_rev': '5e8f36b48f015532cd1165b47686b659fc8870da', + 'dart_protobuf_rev': 'c16bc891978a1764f0d6d8eca54f420242c78a6a', 'dart_pub_rev': 'be6868ba132c782d9835b1638a634ecb73428579', 'dart_root_certificates_rev': '692f6d6488af68e0121317a9c2c9eb393eb0ee50', 'dart_tools_rev': '2c8cbd63b96d94ef4fbc0c7df6fd5eff65fc9a85', @@ -339,13 +339,13 @@ deps = { {'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:acbc179425b4596b7c2ba7d9c4263077f2e18098'}]}, 'src/third_party/dart/third_party/pkg/args': - Var('dart_git') + '/args.git@da56b18ebcb600e050bf57b9c1103b1d2a9fb2ff', + Var('dart_git') + '/args.git@5a4e16f1e4c08b01498a9dce8aeda1a60161cd52', 'src/third_party/dart/third_party/pkg/async': Var('dart_git') + '/async.git@75efa6cc08b2fc906fac4b6fdfdbcf6da7d0a2da', 'src/third_party/dart/third_party/pkg/bazel_worker': - Var('dart_git') + '/bazel_worker.git@f950bbfa4ccb0fe196bd031fae9b824bff25c287', + Var('dart_git') + '/bazel_worker.git@159e67182044b2d5edd89d12a873487d1d1343c1', 'src/third_party/dart/third_party/pkg/boolean_selector': Var('dart_git') + '/boolean_selector.git@f255921c7155da2167e8c96e04e527180787aafb', @@ -375,37 +375,37 @@ deps = { Var('dart_git') + '/dart_style.git@2956b1a705953f880a5dae9d3a0969df0fc45e99', 'src/third_party/dart/third_party/pkg/dartdoc': - Var('dart_git') + '/dartdoc.git@695b218c50dd17a58afa7613da7f0daae3b7f55b', + Var('dart_git') + '/dartdoc.git@a32ba3a16baba6d4c785b0424a1cc3a0e83124ff', 'src/third_party/dart/third_party/pkg/ffi': Var('dart_git') + '/ffi.git@d36e05af55293bcc511d6b3a99ea4b8cb69f6323', 'src/third_party/dart/third_party/pkg/file': - Var('dart_git') + '/external/github.com/google/file.dart@5d9a6027756b5846e8f5380f983390f61f564a75', + Var('dart_git') + '/external/github.com/google/file.dart@a18ad1ce88eaeb5a11a13ef8fc25d1e78b546c59', 'src/third_party/dart/third_party/pkg/fixnum': Var('dart_git') + '/fixnum.git@87ed0658f32f992dc7360b77513eadfa7056aa9d', 'src/third_party/dart/third_party/pkg/glob': - Var('dart_git') + '/glob.git@5b243935154daf53c54981b98f625bace90b2112', + Var('dart_git') + '/glob.git@9c1996f9f9326d776fe151f292912113b8b64aa3', 'src/third_party/dart/third_party/pkg/html': - Var('dart_git') + '/html.git@4060496b0443451c38f8b789db2e44c0d7966171', + Var('dart_git') + '/html.git@a1b193e95f13c995e7f7200ce0d363de5952e383', 'src/third_party/dart/third_party/pkg/http': Var('dart_git') + '/http.git@7fb6fd686f6ce60af300be71a84defcc336d272e', 'src/third_party/dart/third_party/pkg/http_multi_server': - Var('dart_git') + '/http_multi_server.git@aa128cfaf6ef1c9c1ace962ca2dcf6e5dddad441', + Var('dart_git') + '/http_multi_server.git@9d62ea396d7d282592edf994378f67fcde982ce8', 'src/third_party/dart/third_party/pkg/http_parser': - Var('dart_git') + '/http_parser.git@c14fbf6aa7ada5e8912eab4581eb26ff4d101452', + Var('dart_git') + '/http_parser.git@d2d03e7dfa3b7a99515b16f827650d6e210799b5', 'src/third_party/dart/third_party/pkg/intl': Var('dart_git') + '/intl.git@5d65e3808ce40e6282e40881492607df4e35669f', 'src/third_party/dart/third_party/pkg/json_rpc_2': - Var('dart_git') + '/json_rpc_2.git@509f71eef90ec5afb5486b69dab7fed97b9f1eef', + Var('dart_git') + '/json_rpc_2.git@50a37863be221f43ef07533c0c154ae676fc5df0', 'src/third_party/dart/third_party/pkg/leak_tracker': Var('dart_git') + '/leak_tracker.git@098bafcf99a5220e3c352d895d991e163568ee03', @@ -423,13 +423,13 @@ deps = { Var('dart_git') + '/mime.git@37ef637c35896e289fdd37c0ea4680df4ab9f543', 'src/third_party/dart/third_party/pkg/mockito': - Var('dart_git') + '/mockito.git@f5abf11f8e21e61eebc2081e322bdfcab057e988', + Var('dart_git') + '/mockito.git@412c0beb51a12ed4a8833db7f542558ab92c0c65', 'src/third_party/dart/third_party/pkg/native': Var('dart_git') + '/native.git@a2dfedc35960711eb24cb04dcb906793d2222295', 'src/third_party/dart/third_party/pkg/package_config': - Var('dart_git') + '/package_config.git@981c49dfec1e3e3e90f336dcd7c225923d2fd321', + Var('dart_git') + '/package_config.git@ae7ad83de97aba507fd05e97cc372bc6695c1759', 'src/third_party/dart/third_party/pkg/path': Var('dart_git') + '/path.git@96d9183ad4f9e48109fa8d4b8269cf75f13922dd', @@ -444,7 +444,7 @@ deps = { Var('dart_git') + '/pub.git' + '@' + Var('dart_pub_rev'), 'src/third_party/dart/third_party/pkg/pub_semver': - Var('dart_git') + '/pub_semver.git@028b43506a3f7ec7f7b4673a78ba3da3d5fb138d', + Var('dart_git') + '/pub_semver.git@f0be74a446f971db478e68b59ea62e393d6df3bd', 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git@2926f76dc0f713b46ba5d9dbc391e29c6d1521a9', @@ -453,10 +453,10 @@ deps = { Var('dart_git') + '/source_map_stack_trace.git@196d7bfa58ef307687907c323ab8e5fb1f382afa', 'src/third_party/dart/third_party/pkg/source_maps': - Var('dart_git') + '/source_maps.git@97c4833100b1bd8ea7e4a2fa1808383007e2d1e8', + Var('dart_git') + '/source_maps.git@eb3d40a6193adc63da958ed9451e3218bd6e95a0', 'src/third_party/dart/third_party/pkg/source_span': - Var('dart_git') + '/source_span.git@37735aecc5d8c0fb75ed61691bae056510b357bb', + Var('dart_git') + '/source_span.git@48d0f574ee0a92a241c865d47f461803a664b5ba', 'src/third_party/dart/third_party/pkg/sse': Var('dart_git') + '/sse.git@eeb2588ce56a5b2f1e4bbd88c2b35c910c505b71', @@ -477,7 +477,7 @@ deps = { Var('dart_git') + '/test.git@27dcae11f6630c0d980f521cf372e962d286e9d3', 'src/third_party/dart/third_party/pkg/test_reflective_loader': - Var('dart_git') + '/test_reflective_loader.git@0bfaad91ed308ce9da11b48395c8210d7542c16b', + Var('dart_git') + '/test_reflective_loader.git@45c57d62fb08471681cd0b0a1c3b131bf0122929', 'src/third_party/dart/third_party/pkg/tools': Var('dart_git') + '/tools.git' + '@' + Var('dart_tools_rev'), @@ -486,13 +486,13 @@ deps = { Var('dart_git') + '/typed_data.git@80e8943524a627f7ff421ace824f38105983e89a', 'src/third_party/dart/third_party/pkg/usage': - Var('dart_git') + '/usage.git@09bb8472fdafff2c48a19aabbcf57b3af0f43934', + Var('dart_git') + '/usage.git@7b12d510b5abde8a216437b8430ccfd02273625c', 'src/third_party/dart/third_party/pkg/watcher': Var('dart_git') + '/watcher.git' + '@' + Var('dart_watcher_rev'), 'src/third_party/dart/third_party/pkg/web_socket_channel': - Var('dart_git') + '/web_socket_channel.git@4d1b5438d1bdfc6317bf99fd9d9c6e4edb7e9ec5', + Var('dart_git') + '/web_socket_channel.git@af945f1ad3ac4193ed70b4ebfbdcba3b9f0198bc', 'src/third_party/dart/third_party/pkg/webdev': Var('dart_git') + '/webdev.git' + '@' + Var('dart_webdev_rev'), diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index f7823740b1135..395b977e0ed06 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -1602,6 +1602,7 @@ ../../../third_party/dart/runtime/tools/create_snapshot_bin.py ../../../third_party/dart/runtime/tools/create_snapshot_file.py ../../../third_party/dart/runtime/tools/create_string_literal.py +../../../third_party/dart/runtime/tools/dart_profiler_symbols.py ../../../third_party/dart/runtime/tools/dartfuzz/README.md ../../../third_party/dart/runtime/tools/dartfuzz/README_minimize.md ../../../third_party/dart/runtime/tools/dartfuzz/analysis_options.yaml diff --git a/ci/licenses_golden/licenses_dart b/ci/licenses_golden/licenses_dart index f89f886518704..2433a1a934b1b 100644 --- a/ci/licenses_golden/licenses_dart +++ b/ci/licenses_golden/licenses_dart @@ -1,4 +1,4 @@ -Signature: 044dd90b91c540fd2a9d9b99a1fa34db +Signature: 2842791947e56be69f6d021381e26966 ==================================================================================================== LIBRARY: dart @@ -1460,9 +1460,7 @@ ORIGIN: ../../../third_party/dart/runtime/vm/json_stream.cc + ../../../third_par ORIGIN: ../../../third_party/dart/runtime/vm/json_stream.h + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/native_api_impl.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol.h + ../../../third_party/dart/LICENSE -ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_android.cc + ../../../third_party/dart/LICENSE -ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc + ../../../third_party/dart/LICENSE -ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_posix.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_win.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/object_id_ring.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/object_id_ring.h + ../../../third_party/dart/LICENSE @@ -1802,9 +1800,7 @@ FILE: ../../../third_party/dart/runtime/vm/json_stream.cc FILE: ../../../third_party/dart/runtime/vm/json_stream.h FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc FILE: ../../../third_party/dart/runtime/vm/native_symbol.h -FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_posix.cc FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h @@ -2834,7 +2830,6 @@ ORIGIN: ../../../third_party/dart/runtime/vm/kernel_isolate.h + ../../../third_p ORIGIN: ../../../third_party/dart/runtime/vm/kernel_loader.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/kernel_loader.h + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/lockers.cc + ../../../third_party/dart/LICENSE -ORIGIN: ../../../third_party/dart/runtime/vm/native_symbol_fuchsia.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/object_reload.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/object_service.cc + ../../../third_party/dart/LICENSE ORIGIN: ../../../third_party/dart/runtime/vm/os_fuchsia.cc + ../../../third_party/dart/LICENSE @@ -3190,7 +3185,6 @@ FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.h FILE: ../../../third_party/dart/runtime/vm/kernel_loader.cc FILE: ../../../third_party/dart/runtime/vm/kernel_loader.h FILE: ../../../third_party/dart/runtime/vm/lockers.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/object_reload.cc FILE: ../../../third_party/dart/runtime/vm/object_service.cc FILE: ../../../third_party/dart/runtime/vm/os_fuchsia.cc