From d0d9362f968b81123981bc7136cc7b370b273420 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 25 Oct 2021 10:28:19 -0700 Subject: [PATCH 1/5] upgraded usage of BinaryMessenger --- .../androidintent/MethodCallHandlerImplTest.java | 10 +++++----- .../io/flutter/plugins/camera/DartMessengerTest.java | 11 ++++++++++- .../plugins/quickactions/QuickActionsTest.java | 10 +++++++++- .../urllauncher/MethodCallHandlerImplTest.java | 10 +++++----- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java index 0ea03a0690f1..d6f074cdec52 100644 --- a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java +++ b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java @@ -55,7 +55,7 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) - .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); } @Test @@ -67,9 +67,9 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. - verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) - .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); } @Test @@ -79,7 +79,7 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); - verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); } @Test @@ -88,7 +88,7 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); - verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); + verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); } @Test diff --git a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java index 0a2fc43d03cb..f04733bd3993 100644 --- a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java +++ b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java @@ -12,6 +12,7 @@ import android.os.Handler; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import io.flutter.embedding.engine.systemchannels.PlatformChannel; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MethodCall; @@ -31,6 +32,11 @@ public class DartMessengerTest { private static class FakeBinaryMessenger implements BinaryMessenger { private final List sentMessages = new ArrayList<>(); + @Override + BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { + return null; + } + @Override public void send(@NonNull String channel, ByteBuffer message) { sentMessages.add(message); @@ -42,7 +48,10 @@ public void send(@NonNull String channel, ByteBuffer message, BinaryReply callba } @Override - public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {} + public void setMessageHandler( + @NonNull String channel, + BinaryMessageHandler handler, + @Nullable BinaryMessenger.TaskQueue taskQueue) {} List getMessages() { return new ArrayList<>(sentMessages); diff --git a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java index 208a119efafe..575933ed8979 100644 --- a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java +++ b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java @@ -33,6 +33,11 @@ public class QuickActionsTest { private static class TestBinaryMessenger implements BinaryMessenger { public MethodCall lastMethodCall; + @Override + BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { + return null; + } + @Override public void send(@NonNull String channel, @Nullable ByteBuffer message) { send(channel, message, null); @@ -50,7 +55,10 @@ public void send( } @Override - public void setMessageHandler(@NonNull String channel, @Nullable BinaryMessageHandler handler) { + public void setMessageHandler( + @NonNull String channel, + @Nullable BinaryMessageHandler handler, + @Nullable BinaryMessenger.TaskQueue taskQueue) { // Do nothing. } } diff --git a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java index 5e0811399ac6..a41c6a58647e 100644 --- a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java +++ b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java @@ -44,7 +44,7 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) - .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); } @Test @@ -56,9 +56,9 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. - verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) - .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); } @Test @@ -68,7 +68,7 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); - verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); } @Test @@ -77,7 +77,7 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); - verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); + verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); } @Test From 755e897bec83e8064b4b0e496910c97dd707cd48 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 25 Oct 2021 14:34:36 -0700 Subject: [PATCH 2/5] added script to massage stable channel tests --- .cirrus.yml | 2 + ci/stable_conditional.dart | 69 +++++++++++++++++++ .../MethodCallHandlerImplTest.java | 18 +++++ .../plugins/camera/DartMessengerTest.java | 12 +++- .../quickactions/QuickActionsTest.java | 14 +++- .../MethodCallHandlerImplTest.java | 18 +++++ 6 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 ci/stable_conditional.dart diff --git a/.cirrus.yml b/.cirrus.yml index f223ce93dfd2..a8aec0c482e8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -197,6 +197,8 @@ task: - export CIRRUS_CHANGE_MESSAGE="" - export CIRRUS_COMMIT_MESSAGE="" - ./script/tool_runner.sh lint-android # must come after build-examples + stable_channel_conditional_script: + - dart ./ci/stable_conditional.dart $CHANNEL native_unit_test_script: # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they # might include non-ASCII characters which makes Gradle crash. diff --git a/ci/stable_conditional.dart b/ci/stable_conditional.dart new file mode 100644 index 000000000000..75add765e822 --- /dev/null +++ b/ci/stable_conditional.dart @@ -0,0 +1,69 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// stable_conditional.dart +// +// Performs simple find and replace operations for conditional compilation +// before executing stable channel tests. +// +// Example input: +// int main() { +// // FLUTTER_STABLE_CHANNEL_BEGIN +// printf("hello world\n"); +// // FLUTTER_STABLE_CHANNEL_REPLACE +// // printf("goodbye world\n"); +// // FLUTTER_STABLE_CHANNEL_END +// } +// +// Example output: +// int main() { +// printf("goodbye world\n"); +// } + +import 'dart:convert' show LineSplitter; +import 'dart:io' show Directory, FileSystemEntity, File; + +final RegExp _isSourceRegex = + RegExp(r'\.cc$|\.java$|\.m$\.h$|\.c$|\.swift$|\.kt$'); +final RegExp _replacer = RegExp( + r'^\s*// FLUTTER_STABLE_CHANNEL_BEGIN(.*?)^\s*// FLUTTER_STABLE_CHANNEL_REPLACE(.*?)^\s*// FLUTTER_STABLE_CHANNEL_END', + multiLine: true, + dotAll: true); +final RegExp _commentRemover = RegExp(r'^(\s*)\/+\s*(.*)'); +const String _newline = '\n'; + +bool _isSourceFile(FileSystemEntity entity) => + _isSourceRegex.hasMatch(entity.path); + +void _process(FileSystemEntity entity) { + const LineSplitter splitter = LineSplitter(); + final String text = File(entity.path).readAsStringSync(); + String replaced = ''; + int index = 0; + for (final RegExpMatch match in _replacer.allMatches(text)) { + replaced += text.substring(index, match.start); + for (final String line in splitter.convert(match.group(2)!)) { + final RegExpMatch? commentRemoverMatch = _commentRemover.firstMatch(line); + if (commentRemoverMatch != null) { + replaced += commentRemoverMatch.group(1)! + + commentRemoverMatch.group(2)! + + _newline; + } + } + index = match.end; + } + if (replaced.isNotEmpty) { + replaced += text.substring(index, text.length); + File(entity.path).writeAsStringSync(replaced); + print('modified: ${entity.path}'); + } +} + +void main(List args) { + final String channel = args[0]; + if (channel == 'stable') { + final Directory dir = Directory('.'); + dir.list(recursive: true).where(_isSourceFile).forEach(_process); + } +} diff --git a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java index d6f074cdec52..4a9af85cf466 100644 --- a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java +++ b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java @@ -55,7 +55,11 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) + // FLUTTER_STABLE_CHANNEL_BEGIN .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); + // FLUTTER_STABLE_CHANNEL_REPLACE + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -67,9 +71,15 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. + // FLUTTER_STABLE_CHANNEL_BEGIN verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + // verify(secondMessenger, times(1)) + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -79,7 +89,11 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); + // FLUTTER_STABLE_CHANNEL_BEGIN verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -88,7 +102,11 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); + // FLUTTER_STABLE_CHANNEL_BEGIN verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); + // FLUTTER_STABLE_CHANNEL_END } @Test diff --git a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java index f04733bd3993..ef5332f9e600 100644 --- a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java +++ b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java @@ -32,10 +32,14 @@ public class DartMessengerTest { private static class FakeBinaryMessenger implements BinaryMessenger { private final List sentMessages = new ArrayList<>(); + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. + // FLUTTER_STABLE_CHANNEL_BEGIN @Override - BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { + public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { return null; } + // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CHANNEL_END @Override public void send(@NonNull String channel, ByteBuffer message) { @@ -47,11 +51,17 @@ public void send(@NonNull String channel, ByteBuffer message, BinaryReply callba send(channel, message); } + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. + // FLUTTER_STABLE_CHANNEL_BEGIN @Override public void setMessageHandler( @NonNull String channel, BinaryMessageHandler handler, @Nullable BinaryMessenger.TaskQueue taskQueue) {} + // FLUTTER_STABLE_CHANNEL_REPLACE + // @Override + // public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {} + // FLUTTER_STABLE_CHANNEL_END List getMessages() { return new ArrayList<>(sentMessages); diff --git a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java index 575933ed8979..3ccc40241642 100644 --- a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java +++ b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java @@ -33,10 +33,14 @@ public class QuickActionsTest { private static class TestBinaryMessenger implements BinaryMessenger { public MethodCall lastMethodCall; + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. + // FLUTTER_STABLE_CHANNEL_BEGIN @Override - BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { + public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { return null; } + // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CHANNEL_END @Override public void send(@NonNull String channel, @Nullable ByteBuffer message) { @@ -54,6 +58,8 @@ public void send( } } + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. + // FLUTTER_STABLE_CHANNEL_BEGIN @Override public void setMessageHandler( @NonNull String channel, @@ -61,6 +67,12 @@ public void setMessageHandler( @Nullable BinaryMessenger.TaskQueue taskQueue) { // Do nothing. } + // FLUTTER_STABLE_CHANNEL_REPLACE + // @Override + // public void setMessageHandler( + // @NonNull String channel, + // @Nullable BinaryMessageHandler handler) {} + // FLUTTER_STABLE_CHANNEL_END } static final int SUPPORTED_BUILD = 25; diff --git a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java index a41c6a58647e..22f5c630f6e3 100644 --- a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java +++ b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java @@ -44,7 +44,11 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) + // FLUTTER_STABLE_CHANNEL_BEGIN .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); + // FLUTTER_STABLE_CHANNEL_REPLACE + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -56,9 +60,15 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. + // FLUTTER_STABLE_CHANNEL_BEGIN verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + // verify(secondMessenger, times(1)) + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -68,7 +78,11 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); + // FLUTTER_STABLE_CHANNEL_BEGIN verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); + // FLUTTER_STABLE_CHANNEL_END } @Test @@ -77,7 +91,11 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); + // FLUTTER_STABLE_CHANNEL_BEGIN verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); + // FLUTTER_STABLE_CHANNEL_REPLACE + // verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); + // FLUTTER_STABLE_CHANNEL_END } @Test From a5021dd77ef19e637d73cbe65b721d6d8efb2116 Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Mon, 25 Oct 2021 17:01:18 -0700 Subject: [PATCH 3/5] [url_launcher_web] Regenerate mocks used by integration tests. --- .../url_launcher_web_test.mocks.dart | 540 +++++++++--------- .../url_launcher_web/example/pubspec.yaml | 2 +- 2 files changed, 285 insertions(+), 257 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart index 9cd0196f51db..24d694ffa0cc 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart @@ -1,57 +1,54 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Mocks generated by Mockito 5.0.2 from annotations +// Mocks generated by Mockito 5.0.16 from annotations // in regular_integration_tests/integration_test/url_launcher_web_test.dart. // Do not manually edit this file. -import 'dart:async' as _i4; +import 'dart:async' as _i3; import 'dart:html' as _i2; -import 'dart:math' as _i5; -import 'dart:web_sql' as _i3; +import 'dart:math' as _i4; import 'package:mockito/mockito.dart' as _i1; +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types -class _FakeDocument extends _i1.Fake implements _i2.Document {} - -class _FakeLocation extends _i1.Fake implements _i2.Location {} +class _FakeDocument_0 extends _i1.Fake implements _i2.Document {} -class _FakeConsole extends _i1.Fake implements _i2.Console {} +class _FakeLocation_1 extends _i1.Fake implements _i2.Location {} -class _FakeHistory extends _i1.Fake implements _i2.History {} +class _FakeConsole_2 extends _i1.Fake implements _i2.Console {} -class _FakeStorage extends _i1.Fake implements _i2.Storage {} +class _FakeHistory_3 extends _i1.Fake implements _i2.History {} -class _FakeNavigator extends _i1.Fake implements _i2.Navigator {} +class _FakeStorage_4 extends _i1.Fake implements _i2.Storage {} -class _FakePerformance extends _i1.Fake implements _i2.Performance {} +class _FakeNavigator_5 extends _i1.Fake implements _i2.Navigator {} -class _FakeEvents extends _i1.Fake implements _i2.Events {} +class _FakePerformance_6 extends _i1.Fake implements _i2.Performance {} -class _FakeType extends _i1.Fake implements Type {} +class _FakeEvents_7 extends _i1.Fake implements _i2.Events {} -class _FakeWindowBase extends _i1.Fake implements _i2.WindowBase {} +class _FakeWindowBase_8 extends _i1.Fake implements _i2.WindowBase {} -class _FakeFileSystem extends _i1.Fake implements _i2.FileSystem {} +class _FakeFileSystem_9 extends _i1.Fake implements _i2.FileSystem {} -class _FakeStylePropertyMapReadonly extends _i1.Fake +class _FakeStylePropertyMapReadonly_10 extends _i1.Fake implements _i2.StylePropertyMapReadonly {} -class _FakeMediaQueryList extends _i1.Fake implements _i2.MediaQueryList {} - -class _FakeEntry extends _i1.Fake implements _i2.Entry {} +class _FakeMediaQueryList_11 extends _i1.Fake implements _i2.MediaQueryList {} -class _FakeSqlDatabase extends _i1.Fake implements _i3.SqlDatabase {} +class _FakeEntry_12 extends _i1.Fake implements _i2.Entry {} -class _FakeGeolocation extends _i1.Fake implements _i2.Geolocation {} +class _FakeGeolocation_13 extends _i1.Fake implements _i2.Geolocation {} -class _FakeMediaStream extends _i1.Fake implements _i2.MediaStream {} +class _FakeMediaStream_14 extends _i1.Fake implements _i2.MediaStream {} -class _FakeRelatedApplication extends _i1.Fake +class _FakeRelatedApplication_15 extends _i1.Fake implements _i2.RelatedApplication {} /// A class which mocks [Window]. @@ -63,37 +60,52 @@ class MockWindow extends _i1.Mock implements _i2.Window { } @override - _i4.Future get animationFrame => + _i3.Future get animationFrame => (super.noSuchMethod(Invocation.getter(#animationFrame), - returnValue: Future.value(0)) as _i4.Future); + returnValue: Future.value(0)) as _i3.Future); @override _i2.Document get document => (super.noSuchMethod(Invocation.getter(#document), - returnValue: _FakeDocument()) as _i2.Document); + returnValue: _FakeDocument_0()) as _i2.Document); @override _i2.Location get location => (super.noSuchMethod(Invocation.getter(#location), - returnValue: _FakeLocation()) as _i2.Location); + returnValue: _FakeLocation_1()) as _i2.Location); @override set location(_i2.LocationBase? value) => super.noSuchMethod(Invocation.setter(#location, value), returnValueForMissingStub: null); @override _i2.Console get console => (super.noSuchMethod(Invocation.getter(#console), - returnValue: _FakeConsole()) as _i2.Console); + returnValue: _FakeConsole_2()) as _i2.Console); + @override + set defaultStatus(String? value) => + super.noSuchMethod(Invocation.setter(#defaultStatus, value), + returnValueForMissingStub: null); + @override + set defaultstatus(String? value) => + super.noSuchMethod(Invocation.setter(#defaultstatus, value), + returnValueForMissingStub: null); @override num get devicePixelRatio => (super.noSuchMethod(Invocation.getter(#devicePixelRatio), returnValue: 0) as num); @override _i2.History get history => (super.noSuchMethod(Invocation.getter(#history), - returnValue: _FakeHistory()) as _i2.History); + returnValue: _FakeHistory_3()) as _i2.History); @override _i2.Storage get localStorage => (super.noSuchMethod(Invocation.getter(#localStorage), - returnValue: _FakeStorage()) as _i2.Storage); + returnValue: _FakeStorage_4()) as _i2.Storage); + @override + set name(String? value) => super.noSuchMethod(Invocation.setter(#name, value), + returnValueForMissingStub: null); @override _i2.Navigator get navigator => (super.noSuchMethod(Invocation.getter(#navigator), - returnValue: _FakeNavigator()) as _i2.Navigator); + returnValue: _FakeNavigator_5()) as _i2.Navigator); + @override + set opener(_i2.WindowBase? value) => + super.noSuchMethod(Invocation.setter(#opener, value), + returnValueForMissingStub: null); @override int get outerHeight => (super.noSuchMethod(Invocation.getter(#outerHeight), returnValue: 0) @@ -105,353 +117,357 @@ class MockWindow extends _i1.Mock implements _i2.Window { @override _i2.Performance get performance => (super.noSuchMethod(Invocation.getter(#performance), - returnValue: _FakePerformance()) as _i2.Performance); + returnValue: _FakePerformance_6()) as _i2.Performance); @override _i2.Storage get sessionStorage => (super.noSuchMethod(Invocation.getter(#sessionStorage), - returnValue: _FakeStorage()) as _i2.Storage); + returnValue: _FakeStorage_4()) as _i2.Storage); @override - _i4.Stream<_i2.Event> get onContentLoaded => + set status(String? value) => + super.noSuchMethod(Invocation.setter(#status, value), + returnValueForMissingStub: null); + @override + _i3.Stream<_i2.Event> get onContentLoaded => (super.noSuchMethod(Invocation.getter(#onContentLoaded), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onAbort => + _i3.Stream<_i2.Event> get onAbort => (super.noSuchMethod(Invocation.getter(#onAbort), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onBlur => + _i3.Stream<_i2.Event> get onBlur => (super.noSuchMethod(Invocation.getter(#onBlur), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onCanPlay => + _i3.Stream<_i2.Event> get onCanPlay => (super.noSuchMethod(Invocation.getter(#onCanPlay), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onCanPlayThrough => + _i3.Stream<_i2.Event> get onCanPlayThrough => (super.noSuchMethod(Invocation.getter(#onCanPlayThrough), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onChange => + _i3.Stream<_i2.Event> get onChange => (super.noSuchMethod(Invocation.getter(#onChange), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.MouseEvent> get onClick => + _i3.Stream<_i2.MouseEvent> get onClick => (super.noSuchMethod(Invocation.getter(#onClick), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onContextMenu => + _i3.Stream<_i2.MouseEvent> get onContextMenu => (super.noSuchMethod(Invocation.getter(#onContextMenu), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.Event> get onDoubleClick => + _i3.Stream<_i2.Event> get onDoubleClick => (super.noSuchMethod(Invocation.getter(#onDoubleClick), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.DeviceMotionEvent> get onDeviceMotion => + _i3.Stream<_i2.DeviceMotionEvent> get onDeviceMotion => (super.noSuchMethod(Invocation.getter(#onDeviceMotion), returnValue: Stream<_i2.DeviceMotionEvent>.empty()) - as _i4.Stream<_i2.DeviceMotionEvent>); + as _i3.Stream<_i2.DeviceMotionEvent>); @override - _i4.Stream<_i2.DeviceOrientationEvent> get onDeviceOrientation => + _i3.Stream<_i2.DeviceOrientationEvent> get onDeviceOrientation => (super.noSuchMethod(Invocation.getter(#onDeviceOrientation), returnValue: Stream<_i2.DeviceOrientationEvent>.empty()) - as _i4.Stream<_i2.DeviceOrientationEvent>); + as _i3.Stream<_i2.DeviceOrientationEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDrag => + _i3.Stream<_i2.MouseEvent> get onDrag => (super.noSuchMethod(Invocation.getter(#onDrag), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDragEnd => + _i3.Stream<_i2.MouseEvent> get onDragEnd => (super.noSuchMethod(Invocation.getter(#onDragEnd), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDragEnter => + _i3.Stream<_i2.MouseEvent> get onDragEnter => (super.noSuchMethod(Invocation.getter(#onDragEnter), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDragLeave => + _i3.Stream<_i2.MouseEvent> get onDragLeave => (super.noSuchMethod(Invocation.getter(#onDragLeave), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDragOver => + _i3.Stream<_i2.MouseEvent> get onDragOver => (super.noSuchMethod(Invocation.getter(#onDragOver), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDragStart => + _i3.Stream<_i2.MouseEvent> get onDragStart => (super.noSuchMethod(Invocation.getter(#onDragStart), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onDrop => + _i3.Stream<_i2.MouseEvent> get onDrop => (super.noSuchMethod(Invocation.getter(#onDrop), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.Event> get onDurationChange => + _i3.Stream<_i2.Event> get onDurationChange => (super.noSuchMethod(Invocation.getter(#onDurationChange), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onEmptied => + _i3.Stream<_i2.Event> get onEmptied => (super.noSuchMethod(Invocation.getter(#onEmptied), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onEnded => + _i3.Stream<_i2.Event> get onEnded => (super.noSuchMethod(Invocation.getter(#onEnded), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onError => + _i3.Stream<_i2.Event> get onError => (super.noSuchMethod(Invocation.getter(#onError), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onFocus => + _i3.Stream<_i2.Event> get onFocus => (super.noSuchMethod(Invocation.getter(#onFocus), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onHashChange => + _i3.Stream<_i2.Event> get onHashChange => (super.noSuchMethod(Invocation.getter(#onHashChange), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onInput => + _i3.Stream<_i2.Event> get onInput => (super.noSuchMethod(Invocation.getter(#onInput), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onInvalid => + _i3.Stream<_i2.Event> get onInvalid => (super.noSuchMethod(Invocation.getter(#onInvalid), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.KeyboardEvent> get onKeyDown => + _i3.Stream<_i2.KeyboardEvent> get onKeyDown => (super.noSuchMethod(Invocation.getter(#onKeyDown), returnValue: Stream<_i2.KeyboardEvent>.empty()) - as _i4.Stream<_i2.KeyboardEvent>); + as _i3.Stream<_i2.KeyboardEvent>); @override - _i4.Stream<_i2.KeyboardEvent> get onKeyPress => + _i3.Stream<_i2.KeyboardEvent> get onKeyPress => (super.noSuchMethod(Invocation.getter(#onKeyPress), returnValue: Stream<_i2.KeyboardEvent>.empty()) - as _i4.Stream<_i2.KeyboardEvent>); + as _i3.Stream<_i2.KeyboardEvent>); @override - _i4.Stream<_i2.KeyboardEvent> get onKeyUp => + _i3.Stream<_i2.KeyboardEvent> get onKeyUp => (super.noSuchMethod(Invocation.getter(#onKeyUp), returnValue: Stream<_i2.KeyboardEvent>.empty()) - as _i4.Stream<_i2.KeyboardEvent>); + as _i3.Stream<_i2.KeyboardEvent>); @override - _i4.Stream<_i2.Event> get onLoad => + _i3.Stream<_i2.Event> get onLoad => (super.noSuchMethod(Invocation.getter(#onLoad), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onLoadedData => + _i3.Stream<_i2.Event> get onLoadedData => (super.noSuchMethod(Invocation.getter(#onLoadedData), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onLoadedMetadata => + _i3.Stream<_i2.Event> get onLoadedMetadata => (super.noSuchMethod(Invocation.getter(#onLoadedMetadata), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onLoadStart => + _i3.Stream<_i2.Event> get onLoadStart => (super.noSuchMethod(Invocation.getter(#onLoadStart), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.MessageEvent> get onMessage => + _i3.Stream<_i2.MessageEvent> get onMessage => (super.noSuchMethod(Invocation.getter(#onMessage), returnValue: Stream<_i2.MessageEvent>.empty()) - as _i4.Stream<_i2.MessageEvent>); + as _i3.Stream<_i2.MessageEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseDown => + _i3.Stream<_i2.MouseEvent> get onMouseDown => (super.noSuchMethod(Invocation.getter(#onMouseDown), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseEnter => + _i3.Stream<_i2.MouseEvent> get onMouseEnter => (super.noSuchMethod(Invocation.getter(#onMouseEnter), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseLeave => + _i3.Stream<_i2.MouseEvent> get onMouseLeave => (super.noSuchMethod(Invocation.getter(#onMouseLeave), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseMove => + _i3.Stream<_i2.MouseEvent> get onMouseMove => (super.noSuchMethod(Invocation.getter(#onMouseMove), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseOut => + _i3.Stream<_i2.MouseEvent> get onMouseOut => (super.noSuchMethod(Invocation.getter(#onMouseOut), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseOver => + _i3.Stream<_i2.MouseEvent> get onMouseOver => (super.noSuchMethod(Invocation.getter(#onMouseOver), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.MouseEvent> get onMouseUp => + _i3.Stream<_i2.MouseEvent> get onMouseUp => (super.noSuchMethod(Invocation.getter(#onMouseUp), returnValue: Stream<_i2.MouseEvent>.empty()) - as _i4.Stream<_i2.MouseEvent>); + as _i3.Stream<_i2.MouseEvent>); @override - _i4.Stream<_i2.WheelEvent> get onMouseWheel => + _i3.Stream<_i2.WheelEvent> get onMouseWheel => (super.noSuchMethod(Invocation.getter(#onMouseWheel), returnValue: Stream<_i2.WheelEvent>.empty()) - as _i4.Stream<_i2.WheelEvent>); + as _i3.Stream<_i2.WheelEvent>); @override - _i4.Stream<_i2.Event> get onOffline => + _i3.Stream<_i2.Event> get onOffline => (super.noSuchMethod(Invocation.getter(#onOffline), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onOnline => + _i3.Stream<_i2.Event> get onOnline => (super.noSuchMethod(Invocation.getter(#onOnline), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onPageHide => + _i3.Stream<_i2.Event> get onPageHide => (super.noSuchMethod(Invocation.getter(#onPageHide), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onPageShow => + _i3.Stream<_i2.Event> get onPageShow => (super.noSuchMethod(Invocation.getter(#onPageShow), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onPause => + _i3.Stream<_i2.Event> get onPause => (super.noSuchMethod(Invocation.getter(#onPause), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onPlay => + _i3.Stream<_i2.Event> get onPlay => (super.noSuchMethod(Invocation.getter(#onPlay), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onPlaying => + _i3.Stream<_i2.Event> get onPlaying => (super.noSuchMethod(Invocation.getter(#onPlaying), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.PopStateEvent> get onPopState => + _i3.Stream<_i2.PopStateEvent> get onPopState => (super.noSuchMethod(Invocation.getter(#onPopState), returnValue: Stream<_i2.PopStateEvent>.empty()) - as _i4.Stream<_i2.PopStateEvent>); + as _i3.Stream<_i2.PopStateEvent>); @override - _i4.Stream<_i2.Event> get onProgress => + _i3.Stream<_i2.Event> get onProgress => (super.noSuchMethod(Invocation.getter(#onProgress), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onRateChange => + _i3.Stream<_i2.Event> get onRateChange => (super.noSuchMethod(Invocation.getter(#onRateChange), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onReset => + _i3.Stream<_i2.Event> get onReset => (super.noSuchMethod(Invocation.getter(#onReset), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onResize => + _i3.Stream<_i2.Event> get onResize => (super.noSuchMethod(Invocation.getter(#onResize), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onScroll => + _i3.Stream<_i2.Event> get onScroll => (super.noSuchMethod(Invocation.getter(#onScroll), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onSearch => + _i3.Stream<_i2.Event> get onSearch => (super.noSuchMethod(Invocation.getter(#onSearch), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onSeeked => + _i3.Stream<_i2.Event> get onSeeked => (super.noSuchMethod(Invocation.getter(#onSeeked), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onSeeking => + _i3.Stream<_i2.Event> get onSeeking => (super.noSuchMethod(Invocation.getter(#onSeeking), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onSelect => + _i3.Stream<_i2.Event> get onSelect => (super.noSuchMethod(Invocation.getter(#onSelect), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onStalled => + _i3.Stream<_i2.Event> get onStalled => (super.noSuchMethod(Invocation.getter(#onStalled), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.StorageEvent> get onStorage => + _i3.Stream<_i2.StorageEvent> get onStorage => (super.noSuchMethod(Invocation.getter(#onStorage), returnValue: Stream<_i2.StorageEvent>.empty()) - as _i4.Stream<_i2.StorageEvent>); + as _i3.Stream<_i2.StorageEvent>); @override - _i4.Stream<_i2.Event> get onSubmit => + _i3.Stream<_i2.Event> get onSubmit => (super.noSuchMethod(Invocation.getter(#onSubmit), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onSuspend => + _i3.Stream<_i2.Event> get onSuspend => (super.noSuchMethod(Invocation.getter(#onSuspend), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onTimeUpdate => + _i3.Stream<_i2.Event> get onTimeUpdate => (super.noSuchMethod(Invocation.getter(#onTimeUpdate), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.TouchEvent> get onTouchCancel => + _i3.Stream<_i2.TouchEvent> get onTouchCancel => (super.noSuchMethod(Invocation.getter(#onTouchCancel), returnValue: Stream<_i2.TouchEvent>.empty()) - as _i4.Stream<_i2.TouchEvent>); + as _i3.Stream<_i2.TouchEvent>); @override - _i4.Stream<_i2.TouchEvent> get onTouchEnd => + _i3.Stream<_i2.TouchEvent> get onTouchEnd => (super.noSuchMethod(Invocation.getter(#onTouchEnd), returnValue: Stream<_i2.TouchEvent>.empty()) - as _i4.Stream<_i2.TouchEvent>); + as _i3.Stream<_i2.TouchEvent>); @override - _i4.Stream<_i2.TouchEvent> get onTouchMove => + _i3.Stream<_i2.TouchEvent> get onTouchMove => (super.noSuchMethod(Invocation.getter(#onTouchMove), returnValue: Stream<_i2.TouchEvent>.empty()) - as _i4.Stream<_i2.TouchEvent>); + as _i3.Stream<_i2.TouchEvent>); @override - _i4.Stream<_i2.TouchEvent> get onTouchStart => + _i3.Stream<_i2.TouchEvent> get onTouchStart => (super.noSuchMethod(Invocation.getter(#onTouchStart), returnValue: Stream<_i2.TouchEvent>.empty()) - as _i4.Stream<_i2.TouchEvent>); + as _i3.Stream<_i2.TouchEvent>); @override - _i4.Stream<_i2.TransitionEvent> get onTransitionEnd => + _i3.Stream<_i2.TransitionEvent> get onTransitionEnd => (super.noSuchMethod(Invocation.getter(#onTransitionEnd), returnValue: Stream<_i2.TransitionEvent>.empty()) - as _i4.Stream<_i2.TransitionEvent>); + as _i3.Stream<_i2.TransitionEvent>); @override - _i4.Stream<_i2.Event> get onUnload => + _i3.Stream<_i2.Event> get onUnload => (super.noSuchMethod(Invocation.getter(#onUnload), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onVolumeChange => + _i3.Stream<_i2.Event> get onVolumeChange => (super.noSuchMethod(Invocation.getter(#onVolumeChange), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.Event> get onWaiting => + _i3.Stream<_i2.Event> get onWaiting => (super.noSuchMethod(Invocation.getter(#onWaiting), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.AnimationEvent> get onAnimationEnd => + _i3.Stream<_i2.AnimationEvent> get onAnimationEnd => (super.noSuchMethod(Invocation.getter(#onAnimationEnd), returnValue: Stream<_i2.AnimationEvent>.empty()) - as _i4.Stream<_i2.AnimationEvent>); + as _i3.Stream<_i2.AnimationEvent>); @override - _i4.Stream<_i2.AnimationEvent> get onAnimationIteration => + _i3.Stream<_i2.AnimationEvent> get onAnimationIteration => (super.noSuchMethod(Invocation.getter(#onAnimationIteration), returnValue: Stream<_i2.AnimationEvent>.empty()) - as _i4.Stream<_i2.AnimationEvent>); + as _i3.Stream<_i2.AnimationEvent>); @override - _i4.Stream<_i2.AnimationEvent> get onAnimationStart => + _i3.Stream<_i2.AnimationEvent> get onAnimationStart => (super.noSuchMethod(Invocation.getter(#onAnimationStart), returnValue: Stream<_i2.AnimationEvent>.empty()) - as _i4.Stream<_i2.AnimationEvent>); + as _i3.Stream<_i2.AnimationEvent>); @override - _i4.Stream<_i2.Event> get onBeforeUnload => + _i3.Stream<_i2.Event> get onBeforeUnload => (super.noSuchMethod(Invocation.getter(#onBeforeUnload), - returnValue: Stream<_i2.Event>.empty()) as _i4.Stream<_i2.Event>); + returnValue: Stream<_i2.Event>.empty()) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.WheelEvent> get onWheel => + _i3.Stream<_i2.WheelEvent> get onWheel => (super.noSuchMethod(Invocation.getter(#onWheel), returnValue: Stream<_i2.WheelEvent>.empty()) - as _i4.Stream<_i2.WheelEvent>); + as _i3.Stream<_i2.WheelEvent>); @override int get pageXOffset => (super.noSuchMethod(Invocation.getter(#pageXOffset), returnValue: 0) @@ -468,18 +484,12 @@ class MockWindow extends _i1.Mock implements _i2.Window { (super.noSuchMethod(Invocation.getter(#scrollY), returnValue: 0) as int); @override _i2.Events get on => - (super.noSuchMethod(Invocation.getter(#on), returnValue: _FakeEvents()) + (super.noSuchMethod(Invocation.getter(#on), returnValue: _FakeEvents_7()) as _i2.Events); @override - int get hashCode => - (super.noSuchMethod(Invocation.getter(#hashCode), returnValue: 0) as int); - @override - Type get runtimeType => (super.noSuchMethod(Invocation.getter(#runtimeType), - returnValue: _FakeType()) as Type); - @override _i2.WindowBase open(String? url, String? name, [String? options]) => (super.noSuchMethod(Invocation.method(#open, [url, name, options]), - returnValue: _FakeWindowBase()) as _i2.WindowBase); + returnValue: _FakeWindowBase_8()) as _i2.WindowBase); @override int requestAnimationFrame(_i2.FrameRequestCallback? callback) => (super.noSuchMethod(Invocation.method(#requestAnimationFrame, [callback]), @@ -489,25 +499,32 @@ class MockWindow extends _i1.Mock implements _i2.Window { super.noSuchMethod(Invocation.method(#cancelAnimationFrame, [id]), returnValueForMissingStub: null); @override - _i4.Future<_i2.FileSystem> requestFileSystem(int? size, + _i3.Future<_i2.FileSystem> requestFileSystem(int? size, {bool? persistent = false}) => (super.noSuchMethod( Invocation.method( #requestFileSystem, [size], {#persistent: persistent}), - returnValue: Future.value(_FakeFileSystem())) - as _i4.Future<_i2.FileSystem>); + returnValue: Future<_i2.FileSystem>.value(_FakeFileSystem_9())) + as _i3.Future<_i2.FileSystem>); + @override + void alert([String? message]) => + super.noSuchMethod(Invocation.method(#alert, [message]), + returnValueForMissingStub: null); @override void cancelIdleCallback(int? handle) => super.noSuchMethod(Invocation.method(#cancelIdleCallback, [handle]), returnValueForMissingStub: null); @override + void close() => super.noSuchMethod(Invocation.method(#close, []), + returnValueForMissingStub: null); + @override bool confirm([String? message]) => (super.noSuchMethod(Invocation.method(#confirm, [message]), returnValue: false) as bool); @override - _i4.Future fetch(dynamic input, [Map? init]) => + _i3.Future fetch(dynamic input, [Map? init]) => (super.noSuchMethod(Invocation.method(#fetch, [input, init]), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override bool find(String? string, bool? caseSensitive, bool? backwards, bool? wrap, bool? wholeWord, bool? searchInFrames, bool? showDialog) => @@ -527,7 +544,7 @@ class MockWindow extends _i1.Mock implements _i2.Window { _i2.Element? element, String? pseudoElement) => (super.noSuchMethod( Invocation.method(#getComputedStyleMap, [element, pseudoElement]), - returnValue: _FakeStylePropertyMapReadonly()) + returnValue: _FakeStylePropertyMapReadonly_10()) as _i2.StylePropertyMapReadonly); @override List<_i2.CssRule> getMatchedCssRules( @@ -538,7 +555,7 @@ class MockWindow extends _i1.Mock implements _i2.Window { @override _i2.MediaQueryList matchMedia(String? query) => (super.noSuchMethod(Invocation.method(#matchMedia, [query]), - returnValue: _FakeMediaQueryList()) as _i2.MediaQueryList); + returnValue: _FakeMediaQueryList_11()) as _i2.MediaQueryList); @override void moveBy(int? x, int? y) => super.noSuchMethod(Invocation.method(#moveBy, [x, y]), @@ -550,6 +567,9 @@ class MockWindow extends _i1.Mock implements _i2.Window { Invocation.method(#postMessage, [message, targetOrigin, transfer]), returnValueForMissingStub: null); @override + void print() => super.noSuchMethod(Invocation.method(#print, []), + returnValueForMissingStub: null); + @override int requestIdleCallback(_i2.IdleRequestCallback? callback, [Map? options]) => (super.noSuchMethod( @@ -564,9 +584,37 @@ class MockWindow extends _i1.Mock implements _i2.Window { super.noSuchMethod(Invocation.method(#resizeTo, [x, y]), returnValueForMissingStub: null); @override - _i4.Future<_i2.Entry> resolveLocalFileSystemUrl(String? url) => + void scroll( + [dynamic options_OR_x, + dynamic y, + Map? scrollOptions]) => + super.noSuchMethod( + Invocation.method(#scroll, [options_OR_x, y, scrollOptions]), + returnValueForMissingStub: null); + @override + void scrollBy( + [dynamic options_OR_x, + dynamic y, + Map? scrollOptions]) => + super.noSuchMethod( + Invocation.method(#scrollBy, [options_OR_x, y, scrollOptions]), + returnValueForMissingStub: null); + @override + void scrollTo( + [dynamic options_OR_x, + dynamic y, + Map? scrollOptions]) => + super.noSuchMethod( + Invocation.method(#scrollTo, [options_OR_x, y, scrollOptions]), + returnValueForMissingStub: null); + @override + void stop() => super.noSuchMethod(Invocation.method(#stop, []), + returnValueForMissingStub: null); + @override + _i3.Future<_i2.Entry> resolveLocalFileSystemUrl(String? url) => (super.noSuchMethod(Invocation.method(#resolveLocalFileSystemUrl, [url]), - returnValue: Future.value(_FakeEntry())) as _i4.Future<_i2.Entry>); + returnValue: Future<_i2.Entry>.value(_FakeEntry_12())) + as _i3.Future<_i2.Entry>); @override String atob(String? atob) => (super.noSuchMethod(Invocation.method(#atob, [atob]), returnValue: '') @@ -576,18 +624,10 @@ class MockWindow extends _i1.Mock implements _i2.Window { (super.noSuchMethod(Invocation.method(#btoa, [btoa]), returnValue: '') as String); @override - void moveTo(_i5.Point? p) => + void moveTo(_i4.Point? p) => super.noSuchMethod(Invocation.method(#moveTo, [p]), returnValueForMissingStub: null); @override - _i3.SqlDatabase openDatabase(String? name, String? version, - String? displayName, int? estimatedSize, - [_i2.DatabaseCallback? creationCallback]) => - (super.noSuchMethod( - Invocation.method(#openDatabase, - [name, version, displayName, estimatedSize, creationCallback]), - returnValue: _FakeSqlDatabase()) as _i3.SqlDatabase); - @override void addEventListener(String? type, _i2.EventListener? listener, [bool? useCapture]) => super.noSuchMethod( @@ -604,13 +644,7 @@ class MockWindow extends _i1.Mock implements _i2.Window { (super.noSuchMethod(Invocation.method(#dispatchEvent, [event]), returnValue: false) as bool); @override - bool operator ==(Object? other) => - (super.noSuchMethod(Invocation.method(#==, [other]), returnValue: false) - as bool); - @override - String toString() => - (super.noSuchMethod(Invocation.method(#toString, []), returnValue: '') - as String); + String toString() => super.toString(); } /// A class which mocks [Navigator]. @@ -628,7 +662,7 @@ class MockNavigator extends _i1.Mock implements _i2.Navigator { @override _i2.Geolocation get geolocation => (super.noSuchMethod(Invocation.getter(#geolocation), - returnValue: _FakeGeolocation()) as _i2.Geolocation); + returnValue: _FakeGeolocation_13()) as _i2.Geolocation); @override String get vendor => (super.noSuchMethod(Invocation.getter(#vendor), returnValue: '') @@ -658,69 +692,63 @@ class MockNavigator extends _i1.Mock implements _i2.Navigator { (super.noSuchMethod(Invocation.getter(#userAgent), returnValue: '') as String); @override - int get hashCode => - (super.noSuchMethod(Invocation.getter(#hashCode), returnValue: 0) as int); - @override - Type get runtimeType => (super.noSuchMethod(Invocation.getter(#runtimeType), - returnValue: _FakeType()) as Type); - @override List<_i2.Gamepad?> getGamepads() => (super.noSuchMethod(Invocation.method(#getGamepads, []), returnValue: <_i2.Gamepad?>[]) as List<_i2.Gamepad?>); @override - _i4.Future<_i2.MediaStream> getUserMedia( + _i3.Future<_i2.MediaStream> getUserMedia( {dynamic audio = false, dynamic video = false}) => (super.noSuchMethod( Invocation.method(#getUserMedia, [], {#audio: audio, #video: video}), returnValue: - Future.value(_FakeMediaStream())) as _i4.Future<_i2.MediaStream>); + Future<_i2.MediaStream>.value(_FakeMediaStream_14())) as _i3 + .Future<_i2.MediaStream>); @override - _i4.Future getBattery() => + void cancelKeyboardLock() => + super.noSuchMethod(Invocation.method(#cancelKeyboardLock, []), + returnValueForMissingStub: null); + @override + _i3.Future getBattery() => (super.noSuchMethod(Invocation.method(#getBattery, []), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override - _i4.Future<_i2.RelatedApplication> getInstalledRelatedApps() => + _i3.Future<_i2.RelatedApplication> getInstalledRelatedApps() => (super.noSuchMethod(Invocation.method(#getInstalledRelatedApps, []), - returnValue: Future.value(_FakeRelatedApplication())) - as _i4.Future<_i2.RelatedApplication>); + returnValue: Future<_i2.RelatedApplication>.value( + _FakeRelatedApplication_15())) + as _i3.Future<_i2.RelatedApplication>); @override - _i4.Future getVRDisplays() => + _i3.Future getVRDisplays() => (super.noSuchMethod(Invocation.method(#getVRDisplays, []), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override void registerProtocolHandler(String? scheme, String? url, String? title) => super.noSuchMethod( Invocation.method(#registerProtocolHandler, [scheme, url, title]), returnValueForMissingStub: null); @override - _i4.Future requestKeyboardLock([List? keyCodes]) => + _i3.Future requestKeyboardLock([List? keyCodes]) => (super.noSuchMethod(Invocation.method(#requestKeyboardLock, [keyCodes]), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override - _i4.Future requestMidiAccess([Map? options]) => + _i3.Future requestMidiAccess([Map? options]) => (super.noSuchMethod(Invocation.method(#requestMidiAccess, [options]), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override - _i4.Future requestMediaKeySystemAccess(String? keySystem, + _i3.Future requestMediaKeySystemAccess(String? keySystem, List>? supportedConfigurations) => (super.noSuchMethod( Invocation.method(#requestMediaKeySystemAccess, [keySystem, supportedConfigurations]), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override bool sendBeacon(String? url, Object? data) => (super.noSuchMethod(Invocation.method(#sendBeacon, [url, data]), returnValue: false) as bool); @override - _i4.Future share([Map? data]) => + _i3.Future share([Map? data]) => (super.noSuchMethod(Invocation.method(#share, [data]), - returnValue: Future.value(null)) as _i4.Future); + returnValue: Future.value()) as _i3.Future); @override - bool operator ==(Object? other) => - (super.noSuchMethod(Invocation.method(#==, [other]), returnValue: false) - as bool); - @override - String toString() => - (super.noSuchMethod(Invocation.method(#toString, []), returnValue: '') - as String); + String toString() => super.toString(); } diff --git a/packages/url_launcher/url_launcher_web/example/pubspec.yaml b/packages/url_launcher/url_launcher_web/example/pubspec.yaml index 7c00c33550a8..872bc8873b5c 100644 --- a/packages/url_launcher/url_launcher_web/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: sdk: flutter dev_dependencies: - build_runner: ^1.10.0 + build_runner: ^2.1.1 mockito: ^5.0.0 url_launcher_web: path: ../ From 8c69fa103acaf495de61b91e977745faf21a0dff Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 26 Oct 2021 10:05:25 -0700 Subject: [PATCH 4/5] stuart feedback: - renamed comments - forced `//` - put conditional in cirrus.yml - put explicit list of files to process - added space in comment --- .cirrus.yml | 4 ++- ci/stable_conditional.dart | 22 +++++++++------- .../MethodCallHandlerImplTest.java | 26 +++++++++---------- .../plugins/camera/DartMessengerTest.java | 16 ++++++------ .../quickactions/QuickActionsTest.java | 16 ++++++------ .../MethodCallHandlerImplTest.java | 26 +++++++++---------- 6 files changed, 57 insertions(+), 53 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index a8aec0c482e8..7c9ce046dfdb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -198,7 +198,9 @@ task: - export CIRRUS_COMMIT_MESSAGE="" - ./script/tool_runner.sh lint-android # must come after build-examples stable_channel_conditional_script: - - dart ./ci/stable_conditional.dart $CHANNEL + - if [[ "$CHANNEL" == "stable" ]]; then + - dart ./ci/stable_conditional.dart + - fi native_unit_test_script: # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they # might include non-ASCII characters which makes Gradle crash. diff --git a/ci/stable_conditional.dart b/ci/stable_conditional.dart index 75add765e822..4e51ec8ec76d 100644 --- a/ci/stable_conditional.dart +++ b/ci/stable_conditional.dart @@ -9,11 +9,11 @@ // // Example input: // int main() { -// // FLUTTER_STABLE_CHANNEL_BEGIN +// // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE // printf("hello world\n"); -// // FLUTTER_STABLE_CHANNEL_REPLACE +// // FLUTTER_STABLE_CONDITIONAL_ELSE // // printf("goodbye world\n"); -// // FLUTTER_STABLE_CHANNEL_END +// // FLUTTER_STABLE_CONDITIONAL_ENDIF // } // // Example output: @@ -27,10 +27,10 @@ import 'dart:io' show Directory, FileSystemEntity, File; final RegExp _isSourceRegex = RegExp(r'\.cc$|\.java$|\.m$\.h$|\.c$|\.swift$|\.kt$'); final RegExp _replacer = RegExp( - r'^\s*// FLUTTER_STABLE_CHANNEL_BEGIN(.*?)^\s*// FLUTTER_STABLE_CHANNEL_REPLACE(.*?)^\s*// FLUTTER_STABLE_CHANNEL_END', + r'^\s*// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ELSE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ENDIF', multiLine: true, dotAll: true); -final RegExp _commentRemover = RegExp(r'^(\s*)\/+\s*(.*)'); +final RegExp _commentRemover = RegExp(r'^(\s*)\/\/\s*(.*)'); const String _newline = '\n'; bool _isSourceFile(FileSystemEntity entity) => @@ -61,9 +61,11 @@ void _process(FileSystemEntity entity) { } void main(List args) { - final String channel = args[0]; - if (channel == 'stable') { - final Directory dir = Directory('.'); - dir.list(recursive: true).where(_isSourceFile).forEach(_process); - } + final List filesToProcess = [ + 'packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java', + 'packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java', + 'packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java', + 'packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java', + ]; + filesToProcess.map((String path) => File(path)).forEach(_process); } diff --git a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java index 4a9af85cf466..012cc9be9711 100644 --- a/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java +++ b/packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java @@ -55,11 +55,11 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); - // FLUTTER_STABLE_CHANNEL_REPLACE - // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ELSE + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -71,15 +71,15 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); // verify(secondMessenger, times(1)) // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -89,11 +89,11 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -102,11 +102,11 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test diff --git a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java index ef5332f9e600..1ce04d6cc104 100644 --- a/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java +++ b/packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java @@ -32,14 +32,14 @@ public class DartMessengerTest { private static class FakeBinaryMessenger implements BinaryMessenger { private final List sentMessages = new ArrayList<>(); - // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. - // FLUTTER_STABLE_CHANNEL_BEGIN + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable. + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE @Override public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { return null; } - // FLUTTER_STABLE_CHANNEL_REPLACE - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ELSE + // FLUTTER_STABLE_CONDITIONAL_ENDIF @Override public void send(@NonNull String channel, ByteBuffer message) { @@ -51,17 +51,17 @@ public void send(@NonNull String channel, ByteBuffer message, BinaryReply callba send(channel, message); } - // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. - // FLUTTER_STABLE_CHANNEL_BEGIN + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable. + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE @Override public void setMessageHandler( @NonNull String channel, BinaryMessageHandler handler, @Nullable BinaryMessenger.TaskQueue taskQueue) {} - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // @Override // public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {} - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF List getMessages() { return new ArrayList<>(sentMessages); diff --git a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java index 3ccc40241642..2b6fb495f7c4 100644 --- a/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java +++ b/packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java @@ -33,14 +33,14 @@ public class QuickActionsTest { private static class TestBinaryMessenger implements BinaryMessenger { public MethodCall lastMethodCall; - // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. - // FLUTTER_STABLE_CHANNEL_BEGIN + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable. + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE @Override public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() { return null; } - // FLUTTER_STABLE_CHANNEL_REPLACE - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ELSE + // FLUTTER_STABLE_CONDITIONAL_ENDIF @Override public void send(@NonNull String channel, @Nullable ByteBuffer message) { @@ -58,8 +58,8 @@ public void send( } } - // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on master. - // FLUTTER_STABLE_CHANNEL_BEGIN + // TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable. + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE @Override public void setMessageHandler( @NonNull String channel, @@ -67,12 +67,12 @@ public void setMessageHandler( @Nullable BinaryMessenger.TaskQueue taskQueue) { // Do nothing. } - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // @Override // public void setMessageHandler( // @NonNull String channel, // @Nullable BinaryMessageHandler handler) {} - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } static final int SUPPORTED_BUILD = 25; diff --git a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java index 22f5c630f6e3..6b544c7611c5 100644 --- a/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java +++ b/packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java @@ -44,11 +44,11 @@ public void startListening_registersChannel() { methodCallHandler.startListening(messenger); verify(messenger, times(1)) - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); - // FLUTTER_STABLE_CHANNEL_REPLACE - // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ELSE + // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -60,15 +60,15 @@ public void startListening_unregistersExistingChannel() { methodCallHandler.startListening(secondMessenger); // Unregisters the first and then registers the second. - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); verify(secondMessenger, times(1)) .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null)); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null); // verify(secondMessenger, times(1)) // .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class)); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -78,11 +78,11 @@ public void stopListening_unregistersExistingChannel() { methodCallHandler.stopListening(); - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test @@ -91,11 +91,11 @@ public void stopListening_doesNothingWhenUnset() { methodCallHandler.stopListening(); - // FLUTTER_STABLE_CHANNEL_BEGIN + // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null); - // FLUTTER_STABLE_CHANNEL_REPLACE + // FLUTTER_STABLE_CONDITIONAL_ELSE // verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null); - // FLUTTER_STABLE_CHANNEL_END + // FLUTTER_STABLE_CONDITIONAL_ENDIF } @Test From 34980e125789088ecd61f07329468378b44e0362 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 26 Oct 2021 10:37:43 -0700 Subject: [PATCH 5/5] stuart feedback --- ci/stable_conditional.dart | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/ci/stable_conditional.dart b/ci/stable_conditional.dart index 4e51ec8ec76d..76643532bc9d 100644 --- a/ci/stable_conditional.dart +++ b/ci/stable_conditional.dart @@ -22,10 +22,15 @@ // } import 'dart:convert' show LineSplitter; -import 'dart:io' show Directory, FileSystemEntity, File; +import 'dart:io' show FileSystemEntity, File; + +final List _filesToProcess = [ + 'packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java', + 'packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java', + 'packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java', + 'packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java', +]; -final RegExp _isSourceRegex = - RegExp(r'\.cc$|\.java$|\.m$\.h$|\.c$|\.swift$|\.kt$'); final RegExp _replacer = RegExp( r'^\s*// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ELSE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ENDIF', multiLine: true, @@ -33,9 +38,6 @@ final RegExp _replacer = RegExp( final RegExp _commentRemover = RegExp(r'^(\s*)\/\/\s*(.*)'); const String _newline = '\n'; -bool _isSourceFile(FileSystemEntity entity) => - _isSourceRegex.hasMatch(entity.path); - void _process(FileSystemEntity entity) { const LineSplitter splitter = LineSplitter(); final String text = File(entity.path).readAsStringSync(); @@ -61,11 +63,5 @@ void _process(FileSystemEntity entity) { } void main(List args) { - final List filesToProcess = [ - 'packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java', - 'packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java', - 'packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java', - 'packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java', - ]; - filesToProcess.map((String path) => File(path)).forEach(_process); + _filesToProcess.map((String path) => File(path)).forEach(_process); }