Skip to content

Commit 6c06abb

Browse files
authored
Add test for engine artifact framework permissions (#148786)
Framework test to validate the iOS and macOS framework engine artifacts (Flutter.framework and FlutterMacOS.framework) have read and executable permissions. ~~Will fail until flutter/engine#52961 rolls.~~ <-- it rolled flutter/flutter#148819
1 parent f2c48af commit 6c06abb

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,9 @@ void main() {
463463
);
464464
expect(appCodesign, const ProcessResultMatcher());
465465

466-
// Check read/write permissions are being correctly set
467-
final String rawStatString = flutterFrameworkDir.statSync().modeString();
468-
final String statString = rawStatString.substring(rawStatString.length - 9);
469-
expect(statString, 'rwxr-xr-x');
466+
// Check read/write permissions are being correctly set.
467+
final String statString = flutterFrameworkDir.statSync().mode.toRadixString(8);
468+
expect(statString, '40755');
470469
});
471470
}, skip: !platform.isMacOS, // [intended] only makes sense for macos platform.
472471
timeout: const Timeout(Duration(minutes: 10))

packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141

4242
final Directory tempDir = createResolvedTempDirectorySync('macos_content_validation.');
4343

44-
// Pre-cache iOS engine Flutter.xcframework artifacts.
44+
// Pre-cache macOS engine FlutterMacOS.xcframework artifacts.
4545
final ProcessResult result = processManager.runSync(
4646
<String>[
4747
flutterBin,
@@ -54,6 +54,17 @@ void main() {
5454

5555
expect(result, const ProcessResultMatcher());
5656
expect(xcframeworkArtifact.existsSync(), isTrue);
57+
58+
final Directory frameworkArtifact = fileSystem.directory(
59+
fileSystem.path.joinAll(<String>[
60+
xcframeworkArtifact.path,
61+
'macos-arm64_x86_64',
62+
'FlutterMacOS.framework',
63+
]),
64+
);
65+
// Check read/write permissions are set correctly in the framework engine artifact.
66+
final String artifactStat = frameworkArtifact.statSync().mode.toRadixString(8);
67+
expect(artifactStat, '40755');
5768
});
5869

5970
for (final String buildMode in <String>['Debug', 'Release']) {
@@ -164,10 +175,9 @@ void main() {
164175
),
165176
);
166177

167-
// Check read/write permissions are being correctly set
168-
final String rawStatString = outputFlutterFramework.statSync().modeString();
169-
final String statString = rawStatString.substring(rawStatString.length - 9);
170-
expect(statString, 'rwxr-xr-x');
178+
// Check read/write permissions are being correctly set.
179+
final String outputFrameworkStat = outputFlutterFramework.statSync().mode.toRadixString(8);
180+
expect(outputFrameworkStat, '40755');
171181

172182
// Check complicated macOS framework symlink structure.
173183
final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');

0 commit comments

Comments
 (0)