OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ASSERT_TRUE(temp_file); | 107 ASSERT_TRUE(temp_file); |
108 file_util::ScopedFILE temp_file_closer(temp_file); | 108 file_util::ScopedFILE temp_file_closer(temp_file); |
109 | 109 |
110 NSFont* srcFont = [NSFont fontWithName:@"Geeza Pro" size:16.0]; | 110 NSFont* srcFont = [NSFont fontWithName:@"Geeza Pro" size:16.0]; |
111 FontDescriptor descriptor(srcFont); | 111 FontDescriptor descriptor(srcFont); |
112 FontLoader::Result result; | 112 FontLoader::Result result; |
113 FontLoader::LoadFont(descriptor, &result); | 113 FontLoader::LoadFont(descriptor, &result); |
114 EXPECT_GT(result.font_data_size, 0U); | 114 EXPECT_GT(result.font_data_size, 0U); |
115 EXPECT_GT(result.font_id, 0U); | 115 EXPECT_GT(result.font_id, 0U); |
116 | 116 |
117 file_util::WriteFileDescriptor(fileno(temp_file), | 117 base::WriteFileDescriptor(fileno(temp_file), |
118 static_cast<const char *>(result.font_data.memory()), | 118 static_cast<const char *>(result.font_data.memory()), |
119 result.font_data_size); | 119 result.font_data_size); |
120 | 120 |
121 ASSERT_TRUE(RunTestInSandbox(SANDBOX_TYPE_RENDERER, | 121 ASSERT_TRUE(RunTestInSandbox(SANDBOX_TYPE_RENDERER, |
122 "FontLoadingTestCase", temp_file_path.value().c_str())); | 122 "FontLoadingTestCase", temp_file_path.value().c_str())); |
123 temp_file_closer.reset(); | 123 temp_file_closer.reset(); |
124 ASSERT_TRUE(base::DeleteFile(temp_file_path, false)); | 124 ASSERT_TRUE(base::DeleteFile(temp_file_path, false)); |
125 } | 125 } |
126 | 126 |
127 } // namespace content | 127 } // namespace content |
OLD | NEW |