summaryrefslogtreecommitdiffstats
path: root/content/common/sandbox_mac_fontloading_unittest.mm
diff options
context:
space:
mode:
authorbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-09 02:41:13 +0000
committerbashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-09 02:41:13 +0000
commitb54ec1f5e691a02c39a473b96b19986b67deb896 (patch)
treec472eb0873c1c2678346c140bab464bcfa569213 /content/common/sandbox_mac_fontloading_unittest.mm
parentcb9bcfb3f87954a288a70dd1a0a90b74d0b01b56 (diff)
downloadchromium_src-b54ec1f5e691a02c39a473b96b19986b67deb896.zip
chromium_src-b54ec1f5e691a02c39a473b96b19986b67deb896.tar.gz
chromium_src-b54ec1f5e691a02c39a473b96b19986b67deb896.tar.bz2
Mac: OOP font loading should run on FILE thread.
FontLoader calls file_util::GetFileSize() and file_util::ReadFile(), which should be called from the file thread, but FontLoader runs on the io thread now. Make it run on the file thread. BUG=108645 TEST=none Review URL: http://codereview.chromium.org/9950141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131324 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/sandbox_mac_fontloading_unittest.mm')
-rw-r--r--content/common/sandbox_mac_fontloading_unittest.mm18
1 files changed, 9 insertions, 9 deletions
diff --git a/content/common/sandbox_mac_fontloading_unittest.mm b/content/common/sandbox_mac_fontloading_unittest.mm
index 7e7154f..a915c5b 100644
--- a/content/common/sandbox_mac_fontloading_unittest.mm
+++ b/content/common/sandbox_mac_fontloading_unittest.mm
@@ -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 @@ TEST_F(MacSandboxTest, FontLoadingTest) {
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()));