OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/shell/app/webkit_test_platform_support.h" | 5 #include "content/shell/app/webkit_test_platform_support.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <iostream> | 8 #include <iostream> |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool SetupFonts() { | 28 bool SetupFonts() { |
29 // Load Ahem font. | 29 // Load Ahem font. |
30 // AHEM____.TTF is copied to the directory of DumpRenderTree.exe by | 30 // AHEM____.TTF is copied to the directory of DumpRenderTree.exe by |
31 // WebKit.gyp. | 31 // WebKit.gyp. |
32 base::FilePath base_path; | 32 base::FilePath base_path; |
33 PathService::Get(base::DIR_MODULE, &base_path); | 33 PathService::Get(base::DIR_MODULE, &base_path); |
34 base::FilePath font_path = | 34 base::FilePath font_path = |
35 base_path.Append(FILE_PATH_LITERAL("/AHEM____.TTF")); | 35 base_path.Append(FILE_PATH_LITERAL("/AHEM____.TTF")); |
36 | 36 |
37 std::string font_buffer; | 37 std::string font_buffer; |
38 if (!file_util::ReadFileToString(font_path, &font_buffer)) { | 38 if (!base::ReadFileToString(font_path, &font_buffer)) { |
39 std::cerr << "Failed to load font " << WideToUTF8(font_path.value()) | 39 std::cerr << "Failed to load font " << WideToUTF8(font_path.value()) |
40 << "\n"; | 40 << "\n"; |
41 return false; | 41 return false; |
42 } | 42 } |
43 | 43 |
44 DWORD num_fonts = 1; | 44 DWORD num_fonts = 1; |
45 HANDLE font_handle = | 45 HANDLE font_handle = |
46 ::AddFontMemResourceEx(const_cast<char*>(font_buffer.c_str()), | 46 ::AddFontMemResourceEx(const_cast<char*>(font_buffer.c_str()), |
47 font_buffer.length(), | 47 font_buffer.length(), |
48 0, | 48 0, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 std::cerr << *it << "\n"; | 103 std::cerr << *it << "\n"; |
104 } | 104 } |
105 return errors.empty(); | 105 return errors.empty(); |
106 } | 106 } |
107 | 107 |
108 bool WebKitTestPlatformInitialize() { | 108 bool WebKitTestPlatformInitialize() { |
109 return SetupFonts(); | 109 return SetupFonts(); |
110 } | 110 } |
111 | 111 |
112 } // namespace content | 112 } // namespace content |
OLD | NEW |