summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 05:28:41 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-27 05:28:41 +0000
commit8abafc22138e51a1402d4a8a8adc458f6bff9933 (patch)
treee60387f5b45caf6ca9872f9bb542c0248dc6d796 /webkit
parentee0158f8f3da91b66578a8a8d9d8d3cd4a369a69 (diff)
downloadchromium_src-8abafc22138e51a1402d4a8a8adc458f6bff9933.zip
chromium_src-8abafc22138e51a1402d4a8a8adc458f6bff9933.tar.gz
chromium_src-8abafc22138e51a1402d4a8a8adc458f6bff9933.tar.bz2
mac 10.8: Switch test_shell_mac from ATS to CoreText font registration
BUG=139138 Review URL: https://chromiumcodereview.appspot.com/10867081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm24
1 files changed, 7 insertions, 17 deletions
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index 258834b..ccfaa67 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -223,25 +223,15 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
ResetWebPreferences();
// Load the Ahem font, which is used by layout tests.
- const char* ahem_path_c;
NSString* ahem_path = [[base::mac::FrameworkBundle() resourcePath]
stringByAppendingPathComponent:@"AHEM____.TTF"];
- ahem_path_c = [ahem_path fileSystemRepresentation];
- FSRef ahem_fsref;
- if (!base::mac::FSRefFromPath(ahem_path_c, &ahem_fsref)) {
- DLOG(FATAL) << "FSRefFromPath " << ahem_path_c;
- } else {
- // The last argument is an ATSFontContainerRef that can be passed to
- // ATSFontDeactivate to unload the font. Since the font is only loaded
- // for this process, and it's always wanted, don't keep track of it.
- if (ATSFontActivateFromFileReference(&ahem_fsref,
- kATSFontContextLocal,
- kATSFontFormatUnspecified,
- NULL,
- kATSOptionFlagsDefault,
- NULL) != noErr) {
- DLOG(FATAL) << "ATSFontActivateFromFileReference " << ahem_path_c;
- }
+ NSURL* ahem_path_url = [NSURL fileURLWithPath:ahem_path];
+ CFErrorRef error;
+ if (!CTFontManagerRegisterFontsForURL((CFURLRef)ahem_path_url,
+ kCTFontManagerScopeProcess, &error)) {
+ DLOG(FATAL) << "CTFontManagerRegisterFontsForURL "
+ << [ahem_path fileSystemRepresentation]
+ << [[(NSError*)error description] UTF8String];
}
// Add <app bundle's parent dir>/plugins to the plugin path so we can load