Skip to content

Commit

Permalink
Use "Organization Identifier" as prefix for gtest CFBundleIdentifier.
Browse files Browse the repository at this point in the history
Respect the ios_app_bundle_id_prefix and ios_automatically_manage_certs
when generating the Info.plist file for unit tests targets on iOS.

BUG=613543

Review-Url: https://codereview.chromium.org/2441793002
Cr-Commit-Position: refs/heads/master@{#427057}
  • Loading branch information
sdefresne authored and Commit bot committed Oct 24, 2016
1 parent 839adb2 commit ae44722
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions build/config/ios/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ template("ios_info_plist") {
extra_substitutions = invoker.extra_substitutions
}
extra_substitutions += [
"IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix",
"IOS_DEPLOYMENT_TARGET=$ios_deployment_target",
"IOS_PLATFORM_BUILD=$ios_platform_build",
"IOS_PLATFORM_NAME=$ios_sdk_name",
Expand Down
12 changes: 6 additions & 6 deletions testing/gtest_ios/unittest-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.google.gtest.${BUNDLE_ID_TEST_NAME:rfc1034identifier}</string>
<string>${IOS_BUNDLE_ID_PREFIX}.gtest.${GTEST_BUNDLE_ID_SUFFIX:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down Expand Up @@ -151,10 +151,10 @@
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>${BUNDLE_ID_TEST_NAME:rfc1034identifier}.http</string>
<string>${BUNDLE_ID_TEST_NAME:rfc1034identifier}.https</string>
<string>${BUNDLE_ID_TEST_NAME:rfc1034identifier}-x-callback</string>
<string>com.google.sso.${BUNDLE_ID_TEST_NAME:rfc1034identifier}</string>
<string>${PRODUCT_NAME:rfc1034identifier}.http</string>
<string>${PRODUCT_NAME:rfc1034identifier}.https</string>
<string>${PRODUCT_NAME:rfc1034identifier}-x-callback</string>
<string>${IOS_BUNDLE_ID_PREFIX}.sso.${PRODUCT_NAME:rfc1034identifier}</string>
</array>
</dict>
</array>
Expand Down Expand Up @@ -187,6 +187,6 @@
<string>fetch</string>
</array>
<key>SSOAuthURLScheme</key>
<string>com.google.sso.${BUNDLE_ID_TEST_NAME:rfc1034identifier}</string>
<string>${IOS_BUNDLE_ID_PREFIX}.sso.${PRODUCT_NAME:rfc1034identifier}</string>
</dict>
</plist>
8 changes: 7 additions & 1 deletion testing/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,16 @@ template("test") {
info_plist = "//testing/gtest_ios/unittest-Info.plist"
}

_bundle_id_suffix = target_name
if (ios_automatically_manage_certs) {
# Use the same bundle identifier for all unit tests when managing
# certificates automatically as the number of free certs is limited.
_bundle_id_suffix = "generic-unit-test"
}
if (!defined(extra_substitutions)) {
extra_substitutions = []
}
extra_substitutions += [ "BUNDLE_ID_TEST_NAME=$target_name" ]
extra_substitutions += [ "GTEST_BUNDLE_ID_SUFFIX=$_bundle_id_suffix" ]

if (!defined(deps)) {
deps = []
Expand Down

0 comments on commit ae44722

Please sign in to comment.