Skip to content

Commit a4b9ef2

Browse files
Fix more tests for ANSI terminals (flutter#29699)
* have tests that log error messages use a FakePlatform that does not support Ansi color, to fix tests started from color terminals * add the override to the other tests too, in case someone copy & pastes them in the future for a test involving an error message
1 parent 377f445 commit a4b9ef2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/flutter_tools/test/application_package_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ void main() {
131131
});
132132

133133
group('ApkManifestData', () {
134-
test('Parses manifest with an Activity that has enabled set to true, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () {
134+
testUsingContext('Parses manifest with an Activity that has enabled set to true, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () {
135135
final ApkManifestData data = ApkManifestData.parseFromXmlDump(_aaptDataWithExplicitEnabledAndMainLauncherActivity);
136136
expect(data, isNotNull);
137137
expect(data.packageName, 'io.flutter.examples.hello_world');
138138
expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity2');
139-
});
140-
test('Parses manifest with an Activity that has no value for its enabled field, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () {
139+
}, overrides: noColorTerminalOverride);
140+
testUsingContext('Parses manifest with an Activity that has no value for its enabled field, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () {
141141
final ApkManifestData data = ApkManifestData.parseFromXmlDump(_aaptDataWithDefaultEnabledAndMainLauncherActivity);
142142
expect(data, isNotNull);
143143
expect(data.packageName, 'io.flutter.examples.hello_world');
144144
expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity2');
145-
});
145+
}, overrides: noColorTerminalOverride);
146146
testUsingContext('Error when parsing manifest with no Activity that has enabled set to true nor has no value for its enabled field', () {
147147
final ApkManifestData data = ApkManifestData.parseFromXmlDump(_aaptDataWithNoEnabledActivity);
148148
expect(data, isNull);
@@ -156,14 +156,14 @@ void main() {
156156
final BufferLogger logger = context[Logger];
157157
expect(
158158
logger.errorText, 'Error running io.flutter.examples.hello_world. Default activity not found\n');
159-
});
159+
}, overrides: noColorTerminalOverride);
160160
testUsingContext('Error when parsing manifest with no Activity that has category set to android.intent.category.LAUNCHER', () {
161161
final ApkManifestData data = ApkManifestData.parseFromXmlDump(_aaptDataWithNoLauncherActivity);
162162
expect(data, isNull);
163163
final BufferLogger logger = context[Logger];
164164
expect(
165165
logger.errorText, 'Error running io.flutter.examples.hello_world. Default activity not found\n');
166-
});
166+
}, overrides: noColorTerminalOverride);
167167
});
168168

169169
group('PrebuiltIOSApp', () {

0 commit comments

Comments
 (0)