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

Side by Side Diff: content/common/sandbox_mac_fontloading_unittest.mm

Issue 7080024: Mac: Part 1 of a fix to get OOP font loading working in the renderer on 10.6.6 . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/font_loader_mac.mm ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 TEST_F(MacSandboxTest, FontLoadingTest) { 157 TEST_F(MacSandboxTest, FontLoadingTest) {
158 FilePath temp_file_path; 158 FilePath temp_file_path;
159 FILE* temp_file = file_util::CreateAndOpenTemporaryFile(&temp_file_path); 159 FILE* temp_file = file_util::CreateAndOpenTemporaryFile(&temp_file_path);
160 ASSERT_TRUE(temp_file); 160 ASSERT_TRUE(temp_file);
161 file_util::ScopedFILE temp_file_closer(temp_file); 161 file_util::ScopedFILE temp_file_closer(temp_file);
162 162
163 base::SharedMemory font_data; 163 base::SharedMemory font_data;
164 uint32 font_data_size; 164 uint32 font_data_size;
165 uint32 font_id;
165 NSFont* srcFont = [NSFont fontWithName:@"Geeza Pro" size:16.0]; 166 NSFont* srcFont = [NSFont fontWithName:@"Geeza Pro" size:16.0];
166 EXPECT_TRUE(FontLoader::LoadFontIntoBuffer(srcFont, 167 EXPECT_TRUE(FontLoader::LoadFontIntoBuffer(srcFont,
167 &font_data, &font_data_size)); 168 &font_data, &font_data_size, &font_id));
168 EXPECT_GT(font_data_size, 0U); 169 EXPECT_GT(font_data_size, 0U);
170 EXPECT_GT(font_id, 0U);
169 171
170 file_util::WriteFileDescriptor(fileno(temp_file), 172 file_util::WriteFileDescriptor(fileno(temp_file),
171 static_cast<const char *>(font_data.memory()), font_data_size); 173 static_cast<const char *>(font_data.memory()), font_data_size);
172 174
173 ASSERT_TRUE(RunTestInSandbox(Sandbox::SANDBOX_TYPE_RENDERER, 175 ASSERT_TRUE(RunTestInSandbox(Sandbox::SANDBOX_TYPE_RENDERER,
174 "FontLoadingTestCase", temp_file_path.value().c_str())); 176 "FontLoadingTestCase", temp_file_path.value().c_str()));
175 temp_file_closer.reset(); 177 temp_file_closer.reset();
176 ASSERT_TRUE(file_util::Delete(temp_file_path, false)); 178 ASSERT_TRUE(file_util::Delete(temp_file_path, false));
177 } 179 }
178 180
179 } // namespace 181 } // namespace
OLDNEW
« no previous file with comments | « content/common/font_loader_mac.mm ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698