Unverified Commit 0a93f4eb authored by Emmanuel Garcia's avatar Emmanuel Garcia Committed by GitHub

Remove isNewAndroidEmbeddingEnabled flag when reading an existing pro… (#42684)

parent 1dc09e4c
......@@ -17,7 +17,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
instrumentation_adapter: 0.1.3
e2e: 0.2.1
archive: 2.0.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args: 1.5.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......@@ -40,4 +40,4 @@ dev_dependencies:
test_api: 0.2.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
xml: 3.5.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: 8361
# PUBSPEC CHECKSUM: 669f
......@@ -4,10 +4,10 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:release_smoke_test/main.dart' as smoke;
import 'package:instrumentation_adapter/instrumentation_adapter.dart';
import 'package:e2e/e2e.dart';
void main() {
InstrumentationAdapterFlutterBinding.ensureInitialized();
E2EWidgetsFlutterBinding.ensureInitialized();
testWidgets('Hello world smoke test', (WidgetTester tester) async {
smoke.main(); // builds the app and schedules a frame but doesn't trigger one
......
......@@ -7,7 +7,6 @@ import 'package:yaml/yaml.dart';
import 'base/common.dart';
import 'base/file_system.dart';
import 'features.dart';
/// Marker interface for all platform specific plugin config impls.
abstract class PluginPlatform {
......@@ -75,9 +74,6 @@ class AndroidPlugin extends PluginPlatform {
String get _embeddingVersion => _cachedEmbeddingVersion ??= _getEmbeddingVersion();
String _getEmbeddingVersion() {
if (!featureFlags.isNewAndroidEmbeddingEnabled) {
return '1';
}
assert(pluginPath != null);
final String baseMainPath = fs.path.join(
pluginPath,
......
......@@ -360,9 +360,6 @@ List<Map<String, dynamic>> _extractPlatformMaps(List<Plugin> plugins, String typ
/// Returns the version of the Android embedding that the current
/// [project] is using.
String _getAndroidEmbeddingVersion(FlutterProject project) {
if (!featureFlags.isNewAndroidEmbeddingEnabled) {
return '1';
}
assert(project.android != null);
final File androidManifest = project.android.appManifestFile;
assert(androidManifest.existsSync());
......
......@@ -273,7 +273,7 @@ void main() {
..writeAsStringSync('Existing release config');
final FlutterProject project = FlutterProject.fromPath('project');
await injectPlugins(project);
await injectPlugins(project, checkProjects: true);
final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
expect(debugContents, contains(
......
......@@ -148,7 +148,13 @@ flutter:
testUsingContext('Registrant uses old embedding in app project', () async {
when(flutterProject.isModule).thenReturn(false);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(false);
final File androidManifest = flutterProject.directory
.childDirectory('android')
.childFile('AndroidManifest.xml')
..createSync(recursive: true)
..writeAsStringSync(kAndroidManifestUsingOldEmbedding);
when(androidProject.appManifestFile).thenReturn(androidManifest);
await injectPlugins(flutterProject);
......@@ -167,7 +173,6 @@ flutter:
testUsingContext('Registrant uses new embedding if app uses new embedding', () async {
when(flutterProject.isModule).thenReturn(false);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(true);
final File androidManifest = flutterProject.directory
.childDirectory('android')
......@@ -193,7 +198,6 @@ flutter:
testUsingContext('Registrant uses shim for plugins using old embedding if app uses new embedding', () async {
when(flutterProject.isModule).thenReturn(false);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(true);
final File androidManifest = flutterProject.directory
.childDirectory('android')
......@@ -291,7 +295,6 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
testUsingContext('Registrant doesn\'t use new embedding if app doesn\'t use new embedding', () async {
when(flutterProject.isModule).thenReturn(false);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(true);
final File androidManifest = flutterProject.directory
.childDirectory('android')
......@@ -317,7 +320,13 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
testUsingContext('Registrant uses old embedding in module project', () async {
when(flutterProject.isModule).thenReturn(true);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(false);
final File androidManifest = flutterProject.directory
.childDirectory('android')
.childFile('AndroidManifest.xml')
..createSync(recursive: true)
..writeAsStringSync(kAndroidManifestUsingOldEmbedding);
when(androidProject.appManifestFile).thenReturn(androidManifest);
await injectPlugins(flutterProject);
......@@ -336,7 +345,6 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
testUsingContext('Registrant uses new embedding if module uses new embedding', () async {
when(flutterProject.isModule).thenReturn(true);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(true);
final File androidManifest = flutterProject.directory
.childDirectory('android')
......@@ -362,7 +370,6 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
testUsingContext('Registrant doesn\'t use new embedding if module doesn\'t use new embedding', () async {
when(flutterProject.isModule).thenReturn(true);
when(featureFlags.isNewAndroidEmbeddingEnabled).thenReturn(true);
final File androidManifest = flutterProject.directory
.childDirectory('android')
......
......@@ -531,7 +531,12 @@ Future<FlutterProject> someProject() async {
final Directory directory = fs.directory('some_project');
directory.childFile('.packages').createSync(recursive: true);
directory.childDirectory('ios').createSync(recursive: true);
directory.childDirectory('android').createSync(recursive: true);
final Directory androidDirectory = directory
.childDirectory('android')
..createSync(recursive: true);
androidDirectory
.childFile('AndroidManifest.xml')
.writeAsStringSync('<manifest></manifest>');
return FlutterProject.fromDirectory(directory);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment