| Index: components/test_runner/helper/layout_test_helper_mac.mm
|
| diff --git a/components/test_runner/helper/layout_test_helper_mac.mm b/components/test_runner/helper/layout_test_helper_mac.mm
|
| index b787cdcab16760ffdaf690eb6e545cb3194fbdb6..cacf1ad873950343dfc17dcd049e41b0f8d17643 100644
|
| --- a/components/test_runner/helper/layout_test_helper_mac.mm
|
| +++ b/components/test_runner/helper/layout_test_helper_mac.mm
|
| @@ -70,22 +70,51 @@ void InstallLayoutTestColorProfile() {
|
| return;
|
| }
|
|
|
| + CFDictionaryRef factory_info =
|
| + (CFDictionaryRef)CFDictionaryGetValue(device_info,
|
| + kColorSyncFactoryProfiles);
|
| +
|
| + if (!factory_info) {
|
| + NSLog(@"No no factory info; not setting main display's color "
|
| + "profile.");
|
| + CFRelease(device_info);
|
| + CFRelease(main_display_id);
|
| + return;
|
| + }
|
| +
|
| + CFStringRef default_profile_id =
|
| + (CFStringRef)CFDictionaryGetValue(factory_info,
|
| + kColorSyncDeviceDefaultProfileID);
|
| +
|
| + if (!default_profile_id) {
|
| + NSLog(@"No no default profile id; not setting main display's color "
|
| + "profile.");
|
| + CFRelease(factory_info);
|
| + CFRelease(device_info);
|
| + CFRelease(main_display_id);
|
| + return;
|
| + }
|
| +
|
| CFDictionaryRef profile_info = (CFDictionaryRef)CFDictionaryGetValue(
|
| device_info, kColorSyncCustomProfiles);
|
| if (profile_info) {
|
| user_color_profile_url =
|
| - (CFURLRef)CFDictionaryGetValue(profile_info, CFSTR("1"));
|
| + (CFURLRef)CFDictionaryGetValue(profile_info, default_profile_id);
|
| CFRetain(user_color_profile_url);
|
| } else {
|
| profile_info = (CFDictionaryRef)CFDictionaryGetValue(
|
| device_info, kColorSyncFactoryProfiles);
|
| CFDictionaryRef factory_profile =
|
| - (CFDictionaryRef)CFDictionaryGetValue(profile_info, CFSTR("1"));
|
| + (CFDictionaryRef)CFDictionaryGetValue(profile_info,
|
| + default_profile_id);
|
| user_color_profile_url = (CFURLRef)CFDictionaryGetValue(
|
| factory_profile, kColorSyncDeviceProfileURL);
|
| CFRetain(user_color_profile_url);
|
| }
|
|
|
| + CFRelease(default_profile_id);
|
| + CFRelease(factory_info);
|
| + CFRelease(device_info);
|
| CFRelease(device_info);
|
| }
|
|
|
|
|