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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/common/gpu/media/video_encode_accelerator_unittest.cc ('k') | content/public/test/async_file_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698