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

Unified Diff: content/common/sandbox_mac_fontloading_unittest.mm

Issue 10052006: Merge 131324 - Mac: OOP font loading should run on FILE thread. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 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 | « content/common/mac/font_loader.mm ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_mac_fontloading_unittest.mm
===================================================================
--- content/common/sandbox_mac_fontloading_unittest.mm (revision 131698)
+++ content/common/sandbox_mac_fontloading_unittest.mm (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "content/common/mac/font_descriptor.h"
#include "content/common/mac/font_loader.h"
#include "content/common/sandbox_mac_unittest_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -109,17 +110,16 @@
ASSERT_TRUE(temp_file);
file_util::ScopedFILE temp_file_closer(temp_file);
- base::SharedMemory font_data;
- uint32 font_data_size;
- uint32 font_id;
NSFont* srcFont = [NSFont fontWithName:@"Geeza Pro" size:16.0];
- EXPECT_TRUE(FontLoader::LoadFontIntoBuffer(srcFont,
- &font_data, &font_data_size, &font_id));
- EXPECT_GT(font_data_size, 0U);
- EXPECT_GT(font_id, 0U);
+ FontDescriptor descriptor(srcFont);
+ FontLoader::Result result;
+ FontLoader::LoadFont(descriptor, &result);
+ EXPECT_GT(result.font_data_size, 0U);
+ EXPECT_GT(result.font_id, 0U);
file_util::WriteFileDescriptor(fileno(temp_file),
- static_cast<const char *>(font_data.memory()), font_data_size);
+ static_cast<const char *>(result.font_data.memory()),
+ result.font_data_size);
ASSERT_TRUE(RunTestInSandbox(content::SANDBOX_TYPE_RENDERER,
"FontLoadingTestCase", temp_file_path.value().c_str()));
« no previous file with comments | « content/common/mac/font_loader.mm ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698