Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: components/test_runner/helper/layout_test_helper_mac.mm

Issue 2291963002: layout_test_helper crashed if there is no "1" color profile on Mac (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698