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

Side by Side Diff: testing/utils/path_service.cpp

Issue 2382723003: Move core/fxcrt/include to core/fxcrt (Closed)
Patch Set: Rebase to master Created 4 years, 2 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
« no previous file with comments | « testing/libfuzzer/xfa_codec_fuzzer.h ('k') | third_party/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium 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 "testing/utils/path_service.h" 5 #include "testing/utils/path_service.h"
6 6
7 #ifdef _WIN32 7 #ifdef _WIN32
8 #include <Windows.h> 8 #include <Windows.h>
9 #elif defined(__APPLE__) 9 #elif defined(__APPLE__)
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
11 #else // Linux 11 #else // Linux
12 #include <linux/limits.h> 12 #include <linux/limits.h>
13 #include <unistd.h> 13 #include <unistd.h>
14 #endif // _WIN32 14 #endif // _WIN32
15 15
16 #include <string> 16 #include <string>
17 17
18 #include "core/fxcrt/include/fx_system.h" 18 #include "core/fxcrt/fx_system.h"
19 19
20 // static 20 // static
21 bool PathService::EndsWithSeparator(const std::string& path) { 21 bool PathService::EndsWithSeparator(const std::string& path) {
22 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR; 22 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR;
23 } 23 }
24 24
25 // static 25 // static
26 bool PathService::GetExecutableDir(std::string* path) { 26 bool PathService::GetExecutableDir(std::string* path) {
27 // Get the current executable file path. 27 // Get the current executable file path.
28 #ifdef _WIN32 28 #ifdef _WIN32
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool PathService::GetTestFilePath(const std::string& file_name, 94 bool PathService::GetTestFilePath(const std::string& file_name,
95 std::string* path) { 95 std::string* path) {
96 if (!GetTestDataDir(path)) 96 if (!GetTestDataDir(path))
97 return false; 97 return false;
98 98
99 if (!EndsWithSeparator(*path)) 99 if (!EndsWithSeparator(*path))
100 path->push_back(PATH_SEPARATOR); 100 path->push_back(PATH_SEPARATOR);
101 path->append(file_name); 101 path->append(file_name);
102 return true; 102 return true;
103 } 103 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/xfa_codec_fuzzer.h ('k') | third_party/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698