From e38eb756bc5a5f9571e9bcef5b795ea0670d768b Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 22 Oct 2024 12:41:14 -0700 Subject: [PATCH] Test alternate correct macOS framework xcprivacy manifest location (#157318) Cherry-pick the beta branch test https://github.com/flutter/flutter/pull/157136 back to master so this doesn't regress in the next beta. This is the framework test for https://github.com/flutter/flutter/issues/157016 on master. Engine fix can be merged once this merges. --- .../macos_content_validation_test.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart b/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart index 2e6af4156e..d1319d2860 100644 --- a/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart +++ b/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart @@ -225,7 +225,19 @@ void main() { expect(outputFlutterFramework.childDirectory('Headers'), isNot(exists)); expect(outputFlutterFramework.childLink('Modules'), isNot(exists)); expect(outputFlutterFramework.childDirectory('Modules'), isNot(exists)); - expect(outputFlutterFramework.childFile('PrivacyInfo.xcprivacy'), exists); + + // PrivacyInfo.xcprivacy was first added to the top-level path, but + // the correct location is Versions/A/Resources/PrivacyInfo.xcprivacy. + // TODO(jmagman): Switch expectation to only check Resources/ once the new path rolls. + // https://github.com/flutter/flutter/issues/157016#issuecomment-2420786225 + final File topLevelPrivacy = outputFlutterFramework.childFile('PrivacyInfo.xcprivacy'); + final File resourcesLevelPrivacy = fileSystem.file(fileSystem.path.join( + outputFlutterFramework.path, + 'Resources', + 'PrivacyInfo.xcprivacy', + )); + + expect(topLevelPrivacy.existsSync() || resourcesLevelPrivacy.existsSync(), isTrue); // Build again without cleaning. final ProcessResult secondBuild = processManager.runSync(buildCommand, workingDirectory: workingDirectory);